When run SSH, the terminal they give us may sick us due to the ugly interface. To have a proper one, as if run directly on the Unix server, is gnome-terminal.
Run a console and call the following commands :
A GUI-explorer : nautilus
Text editor with syntax highlight: kate
File manager – a very powerful & useful tool to work with your files: krusader
A great IDE application: eclipse
If you want to continue on your current terminal-console, you should run the application in background by adding the & at the end of the program name. E.g.:
The followings format the prompt of the terminal to the form of username@workingFolder and also colorize it.
export PS1="\[$usernameColor\]\u\[$default$pathColor\] \w $ \[$defaultColor\]"
Colorful ls command
alias ls='ls --color'
Note: The above scripts should be put in the .bashrc file in your home folder, e.g. /home/vgnam/.bashrc
google:bash perl replace -> One-line shell script for find and replace
Using perl-like command:
perl -pi -e 's/find/replace/g' *.txt
Used with multiple files:
find . -name '*.txt' |xargs perl -pi -e 's/find/replace/g'
Another way using sed Use the sed command with inline option and regular-expression as :
sed -i -e 's/source/destination/g' *.html
Simply press Ctrl-Shift-X
Firts, extract and copy fonts to:
Login as root user. Then, continue to use the command:
# your program that need to measure time runs here
elapsed=`echo $time2-$time1 | bc`
echo "Elapsed time: $elapsed seconds."
find . -type f -name "yourPatter" -delete
How to get numbers of lines of a huge file? Call the wc command with -l option :
I need to know the memory size, RAM size, of the server which is a Linux OS. I look on the web and found this quite not easy since the input keyword must be precise.
There u can see the line that says: MemFree : ### kB (or mB) is where the free memory is showed. For a brief information output let’s used :
cat /proc/meminfo | grep MemFree
This will show only the MemFree line! What a command!