What is a du Command? du Command Syntax du Command Options Examples of the du command Example 1:- Basic command Example 2:- -h Example 3:- -a Example 4:- -m and -k Example 5:- -s Example 6:- du command with specific sizes Example 7:- --time Example 8:- --exclude Example 9...
That’s where thelogrotatecommandin Linux comes into play.logrotatewill periodically take the current log files, rename them, optionally compress them, and generate a fresh file to which an application can continue sending its logs. Thelogrotatecommand is invoked automatically from cron, and most se...
an argument specifying directory name then this command copies each source file to the destination directory with the same name, created if not existed but if already existed then it will be overwritten, so be careful !!.
The echo command is leveraged to print a string of text passed as an argument to the terminal window. It comes as the built-in command and is frequently used get output status text in shell scripts. For example, a user wants to print ‘play with a string of text’ in the terminal, t...
If you want to terminate all instances of a specific program, you can use the "pkill" command with the program’s name. For example, to kill all instances of "firefox," use: pkill firefox Conclusion: The Linux "kill" command is an invaluable tool for managing processes and controlling the...
Ping command is used to check whether the host is alive or not. It sends and receives the packets in 1 sec time interval. [user1@linuxhelp ~]$ ping google.comPING google.com (216.58.197.78) 56(84) bytes of data. 64 bytes from maa03s21-in-f14.1e100.net (216.58.197.78): icmp_seq...
For example, to change the password as expired for a user named “james“, use the following command: sudo passwd -e james Next, with the help of thechagecommand, we can verify the user james’ password expiration. Finally, thechagecommand views and changes the user password expiry informati...
We can specify multiple permissions with a single command. Use a comma to separate them. For example, the following command first adds the write permission for the group and then removes the execute permission for others. #chmod g+w,o-x test-file ...
This command uses : as the field separator to extract the first field (username) from the /etc/passwd file. 6. Can awk be used with conditions? Yes, awk allows users to apply conditions for pattern matching and executing specific actions based on those conditions. For example: ...
To copy a file with thecpcommand pass the name of the file to be copied and then the destination. In the following example the filefoo.txtis copied to a new file calledbar.txt. The cp command will also create the new file as part of the operation. ...