Run the last executed command begin with a specific letter
Answer:
To run the last executed command begin with a specific letter, e.g.
# date
Thu Mar 18 21:55:55 HKT 2007
!d
date
Thu Mar 18 21:55:57 HKT 2007
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Run the last executed command begin with a specific letter
Answer:
To run the last executed command begin with a specific letter, e.g.
# date
Thu Mar 18 21:55:55 HKT 2007
!d
date
Thu Mar 18 21:55:57 HKT 2007
Change to the previous working directory
Answer:
To change to the previous working directory, use the following command
# cd -
Setup default system timezone in Linux
Answer:
To setup the default system timezone in Linux.
1. Check what timezones are available in your system
# ls /usr/share/zoneinfo/
...
Australia Canada EST ..
..
2. From the list above, pick one you want to set, e.g. Canada
# sudo ln -sf /usr/share/zoneinfo/Canada /etc/localtime
That's all.
Ignoring the program's output
Answer:
Sometimes, you want to throw away the standard output (stdout) from a particular program/command, you can redirect the stdout the the /dev/null
cat test.txt > /dev/null
How to print something to screen
Answer:
Use the echo commamd
# echo "Hello World"
Hello World