4 Lesser Known Commands in Linux














































4 Lesser Known Commands in Linux



1. watch: The watch command in Linux is used to execute a command or a program at fixed intervals. The default interval for the repetition of execution is 2 seconds. 

Syntax: 



Options: 

i-d or -differences: This option highlights the differences that occur in successive executions of the command or program. 

 

 

ii) -n or -interval: This command is used to set the number of seconds after which the command should be executed again. 

 

 

iii) -t or -title: This command is used to remove the command, the interval, and the current time at the top of the head. 

 

 

2. shred: When a file is deleted from the Linux system, the memory space in the disk is freed but the data of that file still exists on the disk. If someone can physically access the disk, they can still acquire the data on that file using advanced techniques. The shred command is used to completely overwrite the file or it also has the option of deleting the file. 

Syntax: 



Options: 

i-n or --iterations: The shred command overwrites a file a certain number of times to hide its data. By, default, it overwrites a file thrice. To change this value, the -n command is used. 

 

ii) -v or --verbose: The -v option is used to display more information about the shredding process when it occurs. 

 

iii) -s or --size: This command is used to specify how much memory of the file must be overwritten. To specify KB, the K suffix is used. To specify MB, the M suffix is used. To specify GB, the G suffix is used. 


 

3. file: The file command is used to know the type (or extension) of a particular file. 

Syntax: 


 

Example: 


 

Options: 

i-b or -brief: This command is used to display the file type in brief mode. 


 

ii) * option: The '*' option shows the file type of all the files present in the system. 


 

iii) directoryname/*: This option is used to see the file types of the files in a particular directory. 

 

 

4. look: This command is used to print the lines of a file that start with a particular string. This command is also used for binary search. 

Syntax: 

 

 

Example: 


 

Options: 

i-f: This command is used to ignore the case of the characters (or string) being searched for. 


 

ii) -t: This command is used to specify a character until which the comparison is done, i.e.only the characters in the string up to and including the first occurrence of the specified character are compared. 

 


Comments