Enable compression during scp transfer
Answer:
When you transfer files which are mainly text based using scp command, it is always good to compress them to save the bandwidth needed.
To do so:
# scp -C test.txt john@remoteserver:/home/john/
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Enable compression during scp transfer
Answer:
When you transfer files which are mainly text based using scp command, it is always good to compress them to save the bandwidth needed.
To do so:
# scp -C test.txt john@remoteserver:/home/john/
Set filename in terminal title in vim
Answer:
To display the currently editing filename in the title of terminal of vim, you can try the tricks below:
1. Press [ESC] to get into command mode
2. Enter :set title
Disable auto /tmp folder clean up when reboot in Debian/Ubuntu
Answer:
In Debian/Ubuntu, the /tmp folder will be auto cleaned up when computer reboot.
To disable this function, do the thing below:
# sudo vim /etc/default/rcS
Change from:
TMPTIME=0
To:
TMPTIME=1
That's all.
How to grep for tab character(s) in Linux
Answer:
To grep for file contains tab characters, you can execute the command below:
# grep $'\t' input.txt
Only show filenames in grep command
Answer:
Sometimes you want the grep command only return the filenames that matched a pattern, you can try the following:
# grep -r -l "foo" .
The key is the -l option.