X
X
X
X

Basic Linux Commands

1. pwd - Print Working Directory

Usage: pwd

Description: This command displays the current directory you are working in. It’s useful for confirming your location within the file system.

2. ls - List Files and Directories

Usage: ls [options] [directory]

Description: Lists files and directories within a directory. Use the -l option for a detailed listing and -a to include hidden files.

Example: ls -la

3. cd - Change Directory

Usage: cd [target directory]

Description: Changes the current working directory. For instance, cd .. moves up one directory level.

Example: cd /home/user/documents

4. touch - Create File

Usage: touch [file name]

Description: Creates a new, empty file. It can also update the timestamp of an existing file.

Example: touch file.txt

5. mkdir - Create Directory

Usage: mkdir [directory name]

Description: Creates a new directory (folder).

Example: mkdir new_directory

6. rm - Remove Files or Directories

Usage: rm [options] [file/directory]

Description: Deletes files or directories. The -r option allows for the deletion of directories and their contents.

Example: rm file.txt or rm -r directory_name

7. cp - Copy Files or Directories

Usage: cp [source] [destination]

Description: Copies files or directories from one location to another. Use the -r option to copy entire directories.

Example: cp file.txt /destination/directory

8. mv - Move/Rename Files or Directories

Usage: mv [source] [destination]

Description: Moves or renames files or directories.

Example: mv old_name.txt new_name.txt

9. cat - Display File Content

Usage: cat [file]

Description: Displays the content of a file in the terminal. Ideal for quickly viewing small files.

Example: cat file.txt

10. echo - Print Message to Terminal

Usage: echo [message]

Description: Prints a message or the value of a variable to the terminal.

Example: echo "Hello World"

11. chmod - Change File Permissions

Usage: chmod [permissions] [file/directory]

Description: Changes the access permissions of a file or directory. For example, chmod 755 gives the owner full access and read-execute access to others.

Example: chmod 644 file.txt

12. man - Command Manual

Usage: man [command]

Description: Provides detailed information on how to use a command.

Example: man ls

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(45 times viewed / 1 people found it helpful)
Top