[{"content":"ls: Lists directories and files in the current directory.\nExample:\nubuntu@panda:~$ ls clab docker-compose downloads hugo package-lock.json scripts compose docker-vol service lasthop powerlevel10k tf pwd: Prints the current working directory.\nExample:\nubuntu@panda:~$ pwd /home/ubuntu cd: Navigate through directories.\nExample:\nubuntu@panda:~$ cd clab ubuntu@panda:~/clab$ cd ubuntu@panda:~$ mkdir: Create directories.\nExample:\nubuntu@panda:~$ mkdir newdir ubuntu@panda:~$ ls clab docker-compose downloads hugo newdir powerlevel10k tf compose docker-vol service lasthop package-lock.json scripts mv: Move or rename files.\nExample:\nubuntu@panda:~$ mv downloads downloads_backup ubuntu@panda:~$ ls clab docker-compose downloads_backup hugo package-lock.json scripts compose docker-vol service lasthop powerlevel10k tf cp: Copy files.\nExample:\nubuntu@panda:~$ cp package-lock.json package-lock-backup.json ubuntu@panda:~$ ls clab docker-compose downloads hugo package-lock-backup.json package-lock.json powerlevel10k scripts compose docker-vol service lasthop tf rm: Delete files or directories.\nExample:\nubuntu@panda:~$ rm package-lock-backup.json ubuntu@panda:~$ ls clab docker-compose downloads hugo package-lock.json powerlevel10k scripts compose docker-vol service lasthop tf touch: Create blank/empty files.\nExample:\nubuntu@panda:~$ touch newfile.txt ubuntu@panda:~$ ls clab docker-compose downloads hugo newfile.txt package-lock.json powerlevel10k scripts compose docker-vol service lasthop tf cat: Display file contents on the terminal.\nExample:\nubuntu@panda:~$ cat newfile.txt hello world clear: Clear the terminal display.\nExample:\nubuntu@panda:~$ clear echo: Print any text that follows the command.\nExample:\nubuntu@panda:~$ echo \u0026quot;hello world\u0026quot; hello world less: Display paged outputs in the terminal.\nExample:\nubuntu@panda:~$ less package-lock.json man: Access manual pages for Linux commands.\nExample:\nubuntu@panda:~$ man ls uname: Get basic information about the OS.\nExample:\nubuntu@panda:~$ uname -a Linux panda 5.15.0-1049-oracle whoami: Get the active username.\nExample:\nubuntu@panda:~$ whoami ubuntu tar: Extract and compress files.\nExample:\nubuntu@panda:~$ tar -xvf archive.tar grep: Search for a string within an output.\nExample:\nubuntu@panda:~$ grep \u0026quot;pattern\u0026quot; filename head: Return the specified number of lines from the top.\nExample:\nubuntu@panda:~$ head -n 5 filename tail: Return the specified number of lines from the bottom.\nExample:\nubuntu@panda:~$ tail -n 5 filename diff: Find the difference between two files.\nExample:\nubuntu@panda:~$ diff file1 file2 cmp: Check if two files are identical.\nExample:\nubuntu@panda:~$ cmp file1 file2 comm: Combine the functionality of diff and cmp.\nExample:\nubuntu@panda:~$ comm file1 file2 sort: Sort the content of a file while outputting.\nExample:\nubuntu@panda:~$ sort filename export: Export environment variables.\nExample:\nubuntu@panda: ps: Display active processes.\nExample:\nubuntu@panda:~$ ps PID TTY TIME CMD 1234 pts/1 00:00:01 bash 5678 pts/1 00:00:03 python kill and killall: Kill active processes by process ID or name.\nExample:\nubuntu@panda:~$ kill 1234 ubuntu@panda:~$ killall python df: Display disk filesystem information.\nExample:\nubuntu@panda:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 20G 15G 4.0G 80% / chmod: Change file permissions.\nExample:\nubuntu@panda:~$ chmod 755 script.sh ubuntu@panda:~$ ls -l script.sh -rwxr-xr-x 1 ubuntu ubuntu 0 Jan 1 12:00 script.sh chown: Grant ownership of files or folders.\nExample:\nubuntu@panda:~$ chown ubuntu:ubuntu script.sh ubuntu@panda:~$ ls -l script.sh -rwxr-xr-x 1 ubuntu ubuntu 0 Jan 1 12:00 script.sh ifconfig: Display network interfaces and IP addresses.\nExample:\nubuntu@panda:~$ ifconfig eth0: flags=4163\u0026lt;UP,BROADCAST,RUNNING,MULTICAST\u0026gt; mtu 1500 inet 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 traceroute: Trace all the network hops to reach the destination.\nExample:\nubuntu@panda:~$ traceroute google.com wget: Direct download files from the internet.\nExample:\nubuntu@panda:~$ wget https://example.com/file.zip cal: View a command-line calendar.\nExample:\nubuntu@panda:~$ cal January 2023 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 alias: Create custom shortcuts for regularly used commands.\nExample:\nubuntu@panda:~$ alias ll='ls -l' ubuntu@panda:~$ ll total 4 drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 1 12:00 clab whereis: Locate the binary, source, and manual pages for a command.\nExample:\nubuntu@panda:~$ whereis ls ls: /bin/ls /usr/share/man/man1/ls.1.gz whatis: Find what a command is used for.\nExample:\nubuntu@panda:~$ whatis ls ls (1) - list directory contents top: View active processes live with their system usage.\nExample:\nubuntu@panda:~$ top useradd and usermod: Add new user or change existing users\u0026rsquo; data.\nExample:\nubuntu@panda:~$ sudo useradd newuser ubuntu@panda:~$ sudo usermod -aG sudo newuser passwd: Create or update passwords for existing users.\nExample:\nubuntu@panda:~$ sudo passwd newuser Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully ls -1 | wc -l: Get the count of the files present in a directory.\nExample:\nubuntu@panda:~$ ls -1 | wc -l 12 kill: Command to kill a process (PID).\nExample:\nubuntu@panda:~$ kill 1234 w: Check how many users are logged into Linux.\nExample:\nubuntu@panda:~$ w 12:00:00 up 10 days, 2:00, 2 users, load average: 0.00, 0.01, 0.05 date: Used to check the current date and time in Linux.\nExample:\nubuntu@panda:~$ date Sat Jan 1 12:00:00 UTC 2023 ls -a: List the hidden files in a directory.\nExample:\nubuntu@panda:~$ ls -a . .. .hiddenfile clab downloads ls -l: Check the permissions on all the files.\nExample:\nubuntu@panda:~$ ls -l total 4 drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 1 12:00 clab ls -R: List information about files and directories within the file system.\nExample:\nubuntu@panda:~$ ls -R .: clab downloads ./clab: file1 file2 ./downloads: file3 file4 rm -rf: Remove directory with the files.\nExample:\nubuntu@panda:~$ rm -rf testdir ubuntu@panda:~$ ls clab downloads ","date":"2023-12-20T00:00:00Z","image":"http://lasthop.xyz/p/essential-linux-commands-for-network-engineers/linux_hu95b3a6173fedc163f136fb30193bd77a_3390025_120x120_fill_box_smart1_3.png","permalink":"http://lasthop.xyz/p/essential-linux-commands-for-network-engineers/","title":"Essential Linux commands for network engineers"}]