Remove downloaded archive files from apt-get
Answer:
To remove ownloaded archive files from apt-get to save spaces, try the following command:
# sudo apt-get clean
So all the unneeded archive files will be removed.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Remove downloaded archive files from apt-get
Answer:
To remove ownloaded archive files from apt-get to save spaces, try the following command:
# sudo apt-get clean
So all the unneeded archive files will be removed.
Compress and decompress file using 7zip
Answer:
7zip is a well known compression program if you need a very small file size, i.e. high compression ratio.
To install under Ubuntu/Debian:
# sudo apt-get install p7zip
To compress a file
# p7zip test.txt
To decompress a file
# p7zip -d test.txt.7z
Output the last N bytes of a file in Linux
Answer:
In previous article, we have shows how to print the first N bytes of a file in Linux. But how to print the last N bytes of a file instead?
Solution:
# tail --byte 4 input.txt
...
The above command print the last 4 bytes of the file input.txt
Print the first N bytes of a file in Linux
Answer:
To print the first N bytes of a file in Linux, you can try the following method:
# head --byte 4 input.txt
...
The above command print the first 4 bytes of the file input.txt
Open UTF8 file with Vim
Answer:
If you opened an UTF-8 file, you need to let vim know by using the command below, after entering the command mode by pressing Esc + :
: set encoding=utf8