How to add line number to a text file?
Answer:
It is very easy with the nl command, when you want to add line number to a text file.
# nl file.txt
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to add line number to a text file?
Answer:
It is very easy with the nl command, when you want to add line number to a text file.
# nl file.txt
How to save a man page to a text file?
Answer:
To save a man page to a text file, you can use the following command:
# man ls| col -b > ls.txt
How to extract a particular file from a tar file?
Answer:
Assume you have a lot of files in a tar file, how do you extract only a particular file without extract all the files?
Just use the following command:
# tar xvf files.tar file.txt
Now only file.txt is extracted.
Quickly clear the screen
Answer:
Previously we discussed how to clear the screen using the clear command. But the most easy way is to type Ctrl+l key in your terminal.
# [Ctrl+l]
How to change hostname in RHEL/CentOS?
Answer:
1. To change the hostname, first change to the root account.
# su -
2. Run the system-config-network tool.
# system-config-network
Reboot your system to take effect.