0% found this document useful (0 votes)
5 views

20_Linux_Commands_1727977623

Uploaded by

spedamkar1993
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

20_Linux_Commands_1727977623

Uploaded by

spedamkar1993
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

20 essential Linux commands you should know

Visit: https://www.careerup.tech to gain real-world hands-on IT/Cybersecurity skills.

1. `ls` – List directory contents


Example: `ls -l`
Shows a detailed list of files and directories in the current directory.

2. `cd` – Change directory


Example: `cd /var/log`
Navigates to the `/var/log` directory.

3. `pwd` – Print working directory


Example: `pwd`
Displays the current directory path.

4. `cp` – Copy files and directories


Example: `cp file1.txt /backup/`
Copies `file1.txt` to the `/backup/` directory.

5. `mv` – Move or rename files


Example: `mv oldname.txt newname.txt`
Renames `oldname.txt` to `newname.txt`.

6. `rm` – Remove files or directories


Example: `rm file1.txt`
Deletes the `file1.txt` file.

7. `mkdir` – Create a new directory


Example: `mkdir newfolder`
Creates a new directory called `newfolder`.

8. `rmdir` – Remove an empty directory


Example: `rmdir oldfolder`
Deletes the empty directory `oldfolder`.

9. `chmod` – Change file permissions


Example: `chmod 755 script.sh`
Gives the file `script.sh` read, write, and execute permissions for the owner and read and execute
permissions for others.

10. `chown` – Change file owner and group


Example: `chown user:group file.txt`
Changes the owner of `file.txt` to `user` and the group to `group`.

11. `ps` – Display running processes


Example: `ps aux`
Lists all running processes with detailed information.

12. `kill` – Terminate a process


Example: `kill 1234`
Kills the process with process ID `1234`.
TIP: Use the ps -aux command to list the processes and their IDs to find the one you need to stop via
the “kill” command.

13. `top` – Real-time view of system processes


Example: `top`
Displays running processes in real-time, including CPU and memory usage.

14. `df` – Display disk space usage


Example: `df -h`
Shows disk usage in a human-readable format (i.e., GB/MB).

15. `du` – Show directory space usage


Example: `du -sh /home/user`
Shows the total disk usage of the `/home/user` directory.

16. `ip` – Display or configure network interfaces


Example: `ip addr show eth0`
Shows the configuration of the network interface `eth0`.

(*Note: `ifconfig` is now deprecated in some distros, consider using `ip`. As detailed below*)

17. `dig` – Domain Information Grouper


Example A record information for google.com: `dig google.com`
Displays domain name, record, and other information

18. `ping` – Check network connectivity


Example: `ping google.com`
Sends ICMP echo requests to `google.com` to test connectivity.

19. `ss` – Socket statistics


Example: `ss -ntr`
Shows TCP sockets without name resolution “-n” .

20. `ssh` – Securely connect to remote machines


Example: `ssh user@hostname`
Establishes an SSH connection to the remote host `hostname` as `user`.

Visit: https://www.careerup.tech to gain real-world hands-on skills and learn how to land your IT/
Cybersecurity position through my affordable training. Take your skills beyond entry-level and open up
opportunities in IT and Cybersecurity today.

You might also like