Thursday, 24 March 2011

Commands for files and directories in Unix /Linux Suse

To remove a directory:
# rmdir <name of directory>

The above command does not delete directories with contents in it. Use this command to delete directories with contents:
# rm -rf <name of directory>

To check the difference between 2 text files in Linux:
# diff <name of file 1> <name of file 2> eg: diff file1.txt file2.txt

To see the format of the file
# file <name of the file>

To find a file in a directory tree
# find dir -name <name of the file> -print

Shell input and output commands wbere i want to send an output to file instead of displaying onto the terminal. I use the redirection '>' character:
# <enter the command first, then the redirection> > test.txt
eg: df -l > check_disk.txt

To append the output to a file, simply issue the command again as shown above with another redirection char.
eg: df -l >> check_disk.txt

No comments:

Post a Comment

Cash flow Forecasting

Why cash forecasting? A cash forecasting model is an essential tool for treasuer to manage working capital. Forecasting preempt treasurer ...