Like ps, the top command lists all processes running on a Linux system. It acts as a process management tool by enabling you to prioritize, sort, or terminate processes interactively. It displays a dynamic process status, reflecting real-time changes. Syntax The syntax of the top command is: # top [options] Listing the state of running […]
Archives for September 2021
ps Command Examples in Linux
The ps command invokes the process table, a record that summarizes the currently running processes on a system. When the command is run without any option, it displays the processes run by the current shell with details such as the PID, the terminal associated with the process, the accumulated CPU time, and the command that […]
service Command Examples in Linux
The service command is another way to control SysVinit services through SysVinit scripts. It supports the following subcommands. Subcommand Used To {service} status Print current state of service. {service} start Activate service immediately. {service} stop Deactivate service immediately. {service} restart Restart service immediately. {service} reload Re-read config files while service runs. Syntax The syntax of […]
chkconfig Command Examples in Linux
The chkconfig command can be used to control services at each runlevel. It can also be used to start or stop services during system startup. Syntax The syntax of the chkconfig command is: # chkconfig [options] [service] [subcommand] The following are some subcommands and options that can be used with chkconfig to control services. Option […]
hwclock Command Examples in Linux
The hwclock command enables you to view and set the hardware clock. As mentioned before, it is strongly recommended that you keep the hardware clock aligned with UTC to prevent over- correction by other operating systems. You can also use the hwclock command to adjust the systematic drift. The systematic drift is the predictable amount […]
date Command Examples in Linux
The date command is used to print the date in a specified format. The date command will print the date based on the /etc/localtime file. By default, it will print the date in the following format: [day of week] [month] [day] [24 hour time ##:##:##] [time zone] [year] Wed Oct 31 15:03:16 GMT 2018 You […]
ln Command Examples in Linux
The ln command is used to create a link to a file. Linking enables a file name in one directory (the link) to point to a file in another directory (the target). A link does not contain data of its own, only a reference to the target file. Any changes to the link will reflect […]
wc Command Examples in Linux
The word count (wc) command is used to count the number of lines, words, and characters in a text file. If multiple files are specified, then the command displays the counts for each file and the total count for all files. Syntax The syntax of the wc command is: # wc [options] {file names} wc […]
echo Command Examples in Linux
The echo command is used to display a line of text on the terminal. You can also use the echo command to write text to a file by providing the string after the echo command and redirecting to the file. Syntax The syntax of the echo command is: # echo {string} echo Command Examples 1. […]
mkdir and rmdir Command Examples in Linux
The mkdir command is used to create (or make) a directory. You supply the name of the directory as an argument. The rmdir directory is used to remove directories, but only those that are empty (i.e., contain no files or subdirectories). In order to delete a directory with actual contents, you must use the rm […]