This command opens the manual page for the command or utility specified.
find / -name grub.conf
But this search took several minutes to complete because we have to search all directories and sub directories. So we can specify the directory.
find /etc -name grub.conf
In default, The head command display top 10 lines of a file. But we can specify the number of lines.
head -n15 /etc/passwd
To display the last bottom lines of file, we have to use tail command.
Same like head command, we can specify the number of lines.
tail -n15 /etc/passwd
cp file1.txt file2.txt
cp command take the contents of one file and place a copy with the same or different name in the directory of our choice.
mv file1 file2
grep 'vickey' /etc/passwd
The command output will be in number of lines, number of words and number of character format. If we only need any one of them , use option
-l for line numbers,
-w for words and
-c for characters.
wc -l file1.txt
sed 's/Windows/Linux/' data.txt > newdata.txt
The above command find the first instance of
Windows in each line from
data.txt file and replace that text with
Linux and save the whole content to
cal command will display current month calendar. But we can also specify the year.