Common Linux Commands

Common Linux Commands

Command

Related Word/Phrase

Description

cd

Change Directory

Moves the user into the specified directory

cd .. to move one directory up

cd by itself to move to home directory

cd- to move to previous directory

cd <directory-path> to move to a directory (can be an absolute path or relative path)

cp <old_file_path> <new_directory_path>

Copy

Copies the file into the specified directory

clear

Clear

Clears the terminal

cat <filename>

Concatenate

Lists the contents of a file

ls

List

Lists contents within the current directory

grep <string_to_match> <filename>

Globally Search for a Regular Expression and Print Matching Lines

Searches for the string / regular expression within the specified file and prints the line(s) with the result

pwd

Present Working Directory

Displays the path of the current directory that you are in

man <command>

Manual

Displays the manual instruction for the given command

mv <file_name> <new_directory>

Move

Moves a file into a new directory

mv <old_file_name> <new_file_name> to rename a file

mkdir <directory_name>

Make Directory

Creates a new directory

rm <directory_name>

Remove

Deletes directories and the contents within them

rmdir <directory_name>

Remove Directory

Removes the specified directory (must be empty)

touch

Touch

Creates a blank new file

Last updated

Was this helpful?