This article describes how to manage your files in Red Hat Enterprise Linux 5 or CentOS 5.
File Management (GUI)
Managing files in GUI mode is a simple as launching the File Browser.
File Management (Console)
Below are the console commands to manage files. This is just an overview of the commands available, to get more information, type in man command to get the manual for the specified command.
- cp -a source dest
copy the specified file or directory
- rm -rf name
delete the specified file or directory and all of its contents
- mv old new
move a file or directory to a new location. Also used to rename a file or directory
- ln -s source linkname
create a symbolic link to the specified file or directory
change to the home directory
- cd path
change to the specified directory
print working directory
- mkdir name
create the specified directory
- rmdir name
delete the specified directory. Directory should be empty
- chown owner file
change the file owner to the specified user
- chmod permissions files
change the file permissions
- cat file
shows the file content
- more file
shows the file content a few screens at a time
- less file
shows the file content similar to how vi displays a file
- vi file
edit the specified file. Learn how to use the vi editor
- head file
shows the first few lines of a file
- tail file
shows the last few lines of a file
- sort file
shows the file content in order by lines
- uniq file
shows the file content, discarding all but one of successive identifical lines
- grep pattern file
searches for the pattern inside the specified file
- file filename
determine file type
- diff file1 file1
compares two files
It is painful to work with Linux if you are not familiar with its arcane commands. Googling the right command for every problem encountered wastes a lot of valuable time.
Learning its commands enables you to do more with less time. Wouldn’t it be great if those backups are performed automatically everyday. Or you are notified via email if your file server is about to run out of disk space.
This book provides a comprehensive list of Linux commands and shows you how to use them in a clear and concise manner.
Visit the forum to ask for help or to give a comment.