Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Linux-Commands

Table of Contents

ls

Lists files and directories in the current directory.

ls

pwd

Displays the current working directory.

pwd

mkdir

Creates a new directory.

mkdir /directory-path/directory-name

rmdir

Removes an empty directory.

rmdir /director-path/directory-name

touch

Creates an empty file or updates the timestamp of an existing file.

touch file-name

cd

Changes the current working directory.

cd /directory-path

cd ..

Moves one directory up.

cd ..

ls -a

Lists all files, including hidden files.

ls -a

ls -l

Lists files in long format with detailed information.

ls -l

Renaming

Renames a file.

mv oldname.txt newname.txt

To move

Moves a file to a different directory.

mv file.txt /directory-path-we-want-to-move

Copy File

Copies a file from one location to another.

cp source.txt destination.txt

Copy Directory

Copies the entire directory /source_dir and its contents (including subdirectories) to /dest_dir

cp -r /source_dir /dest_dir

File Permission

Changes file permissions recursively to allow full read, write, and execute access to all users.

sudo chmod -R 777 /path

Find Files

Finds files with a specific pattern in a directory.

find /path -name "*.txt" 

Curl

Downloads a file from a URL.

curl -O http://example.com/file.zip

Update packages

Updates the package list on Ubuntu/Debian-based systems.

sudo apt update

Restart

Reboots the system.

sudo reboot

Compress as Zip file

Compresses a file into a zip archive.

zip [zip-name] [the-file-name-you-want-to-compress]

Extract Zip File

Extracts files from a zip archive.

unzip [zip-file-name]

Open

Open a file.

open filename

clear

The clear command is used to clear the terminal screen

clear

nano

it opens for editing. If it doesn't exist, nano creates a new file.

nano file-name

whoami

It print the current username

pwd

grep [options] pattern [file]

The grep command searches for a specific pattern (text) within files or output and displays matching lines.

grep "hello" file.txt

About

This repostiory contains descriptions and examples for commonly used Linux commands.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors