Listing files (ls)
If you want to see the list of files on your UNIX or Linux system, use the ‘ls‘ command.
It shows the files /directories in your current directory.
Suppose, your “Music” folder has following sub-directories and files.
You can use ‘ls -R‘ to shows all the files not only in directories but also subdirectories.
‘ls -al‘ gives detailed information of the files.
The command provides information in a columnar format. The columns contain the following information:
1st Column File type and access permissions
2nd Column # of HardLinks to the File
3rd Column Owner and the creator of the file
4th Column Group of the owner
5th Column File size in Bytes
6th Column Date and Time
7th Column Directory or File name
Hidden Files – ls -a
Hidden items in Linux begin with . “period”
Deleting Files
The ‘rm‘ command removes files from the system without confirmation.
Moving and Re-naming files
mv filename new_file_location/or new_file_name
Directory Manipulations
mkdir my_directory
Renaming Directory
The ‘mv‘ (move) command can also be used for renaming directories. Use the below-given format:
mv directoryname newdirectoryname