How to redirect output to a file
Answer:
Use the > for output (standard output) redirection, e.g.
echo "foo" > bar.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 redirect output to a file
Answer:
Use the > for output (standard output) redirection, e.g.
echo "foo" > bar.txt
Rename file in Linux
Answer
The easiest way to rename a file in Linux is to move the file, using the mv command.
e.g.
# mv old_file.txt new_file.txt
Print the last executed command begin with a specific letter
To print the last executed command begin with a specific letter, e.g.
# date
Thu Mar 18 21:55:55 HKT 2007
!d:p
date
The key is the :p modifier
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 -