In this article, I will tell you all the commands of Linux, so let's start the reading without wasting any time
Processes navigation command।
(1) p.s. - List active processes.
(2) pstree - Show processes in a tree- like diagram.
(3) pmap - Display a memory usage map of processes.
(4) top - See all running processes.
(5) htop - Interactive and colorful process viewer.
(6) kill then process id -Terminate a Linux process under a given ID.
(7) pkill then process_name - Terminate a process under a specific name.।
(8) killall then label - Terminate all processes with a given label
(9) prgrep then keyword - List processes based on the provided keyword.
(10) pidof then process name - Show the PID of a process.
(11) bg - List and resume stopped jobs in the background.
(12) f.g. - Bring the most recently suspended job to the foreground.
(13) fg then job - Bring a particular job to the foreground.
(14) Isof - List files opened by running processes.
(15) trap then "[commands]" [signal] -
Catch a system error signal in a shell script. Executes provided commands when the signal is caught.
(16) ls - list all file and directories in current directory.
(17) ls -a list all files and directories including hidden in current directory.
(18) wait - Pause the terminal or a Bash script until a running process is completed. ।
(19) nohup -Run a Linux process in the background.
Commands related to files ।
(20) mkdir then directory name - Create a new directory.
(21) rm after file name - Remove a file. ।
(22) rm -r after directory name - Remove a directory recursively.
(23) rm -rf after directory name - Recursively remove a directory without requiring confirmation.
(24) cp [source_file] [destination_file] - Copy the contents of one file to another file.
(25) cp -r [source_directory] [destination_directory] - Recursively copy a directory to a second directory.
(26) mv after source file after destination file -
(27) Move or rename files or directories.
(28) In -s [path]/[file_name] [link_name] - Create a symbolic link to a file.
(29) touch after file name - Create a new file.
(30) cat after file name - Show the contents of a file.
(31) cat after source file >> destination file -
Append file contents to another file.
(32) head after file name - Show the first ten lines of a file.
(33) tail after file name - Show the last ten lines of a file.।
(34) more after file name - Display contents of a file page by page.।
(35) less after file name - Show the contents of a file with navigation.।
(36) nano after file name - Open or create a file using the nano text editor.
(37) vi after file name - Open or create a file using the Vi/Vim text editor.
(38) vim after file name - Encrypt a file.
(39) gpg -c after file name - Decrypt an encrypted.gpg file.
(40) gpg after file name.gpg - Show the number of words, lines, and bytes in a file. ।
(41) wc-w after file name - show the number of words, lines and bytes in file.
(42) Is xargs wc - List the number of lines, words and character in each file of a directory.
Hardware Information command।
(43) Iscpu - See CPU information
(44) Isblk - See information about block devices ।
(45) Ispci-tv - Show PCI devices in a tree- like diagram.
(46) Isusb-tv - Display USB devices in a tree-like diagram.
(47) Ishw - List hardware configuration information.
(48) cat/proc/cpuinfo - Show detailed CPU information.।
(49) cat/proc/meminfo - View detailed system memory information.
(50) cat/proc/mounts - See mounted file systems.
(51) free -h - Display free and used memory.
(52) sudo dmidecode - Show hardware information from the BIOS.
(53) hdparm -i/dev/ thendevice name - Display disk data information.
(54) hdparm -tT /dev/ then device_name - Conduct a read speed test on the device/disk.
(55) badblocks -s /dev/ then device_name - Test for unreadable blocks on the device/disk.।
(56) fsck /dev/ then device_name - Run a disk check on an unmounted disk or partition.
Disk Usage commands ।
(57) df -h - Check free and used space on mounted systems.
(58) df -i - Show free inodes on mounted file systems.
(59) fdisk -l - Display disk partitions, sizes, and types with the command.
(60) du-ah - See disk usage for all files and directories.
(61) du -sh - Show disk usage of the current directory.
(62) mount - Show currently mounted file systems.
(63) findmnt - Display target mount point for all file systems.
(64) mount [device_path] [mount_point] - Mount a device.
Packages (Universal) command
(65) tar zxvf [file_name.tar.gz] cd [extracted_directory]
./configure make
make install - Install software from source code.
(66) sudo snap install then package name - Install a Snap package.
(67) sudo snap find then type keyword - Search for a package in the Snap store.
(68) sudo snap list -- List installed Snap packages.
(69) flatpak install then package name - Install a Flatpak package.
(70) flatpak search type keyword - Search for a Flatpak application in repositories.
(71) flatpak list - List installed Flatpack packages.
Network navigation command
(72) ip addr show - List IP addresses and network interfaces.
(73) ip address add IP address - Assign an IP address to interface eth0.
(74) ifconfig - Display IP addresses of all network interfaces.
(75) ping after remote host ip address - Ping remote host
(76)netstat -pnltu - See active (listening) ports with the netstat command.
(77) netstat -tuln- Show TCP and UDP ports and their programs.
(78) whois after domain name - Display more information about a domain.
(79) dig after domain name - Show DNS information about a domain using the dig command.
(80) dig -x after domain_name - Do a reverse DNS lookup on the domain.
(81) dig -x [IP_address] - Do a reverse DNS lookup of an IP address.
(82) host [domain_name] - Perform an IP lookup for a domain.
(83) hostname -l - Show the local IP address
(84) nslookup then domain name - Receive information about an internet domain like name server.
Next File Compression commands
(85) tar cf then archive.tar after file or directory and press enter - used for Archive an existing file or directory.
(86) tar xf and archive.tar - this command used for Extract an archived file.
(87) tar czf after archive.tar.gz - Create a .gz compressed tar archive.
(88) gzip after file name after gunzip after file_name.gz - this command used for
(89) Compress or decompress.gz files. -
(90) bzip2 then file name then bunzip2 then file name.bz2 - This command used for
Compress or decompress .bz2 files.
File Transfer commands ।
(91) scp then source file - Copy a file to a server
(92) wget link or url - This command used for
Download files from FTP or web servers.
(93) curl -O after link - Transfer data to or from a server with various protocols.
(94) ftp after adress of remote host - Transfer files between local and remote systems interactively using FTP.
(95) sftp - Securely transfer between remote and local host through sftp.
File permission commands
(96) chmod 777 and file name - Assign read, write, and execute file permission to everyone
(97) chmod 755 after file name - Give read, write, and execute permission to owner, and read and execute permission to group and others ।
(98)chmod 766 after file name - Assign full permission to the owner, and read and write permission to the group and others.
(99) chown after user name after file name -
Change the ownership of a file with chown command ।
(100) chown after user name : group name then file name - Change the owner and group ownership of a file.Packages (Red Hat, CentOS, Fedora)
(101) sudo yum install package name - Install a package using the YUM package manager.
(102) yum search and then keyword - Find a package in the YUM repositories based on the provided keyword.
(103) yum list installed - List all packages installed with YUM।
(104) yum info then package name - Show package information for a package.
(105) sudo dnf install then package name -
Install a package using the DNF package manager.।
System Management commands which is used in Linux
(106) uname -r. - Show system information via uname command.
(107) uname -a - See kernel release information.
(108) uptime -Display how long the system has been running, including the load average.
(109) hostname - View system hostname.
(110) hostname -i Show the IP address of the system.
(111) last reboot - List system reboot history.
(112) date - See current time and date.
(113) timedatectl - Query and change the system clock.
(114) cal - Show current calendar (month and day).
(115) W - List logged-in users.
(116) whoami - See which user you are using.
(117) finger after user name - Show information about a particular user.
(118) shutdown then type time in [hh:mm]
-Schedule a system shutdown.
(119) shutdown now - Shut down the system immediately.
(120) modprobe and type module name - Add a new kernel module.
(121) dmesg - Show bootup messages
(122) history - Print the command history used in the terminal.
(123) clear - clear the terminal.
(124) exit - exit from terminal.
(125) su - switch user.
(126) sudo useradd then user name - create user name.
(127) sudo userdel and then user name - delete user name.
(128) sudo groupadd then group name - create group
(129) passwd sudo passwd then user name - change password.
(130) cd - change directory
(131) pwd - current working directory.
(132) cd .. - one directory back.
(133) cd - change the previous directory l.
(134) cd ~ - go to home directory.
(135) dirs - show directory stack.
I hope you will like this article
0 Comments