Table of contents
To view what's written in a file.
cat filename
To change the access permissions of files.
chmod 777 foldername
-
How do I change directory permissions in Linux?
To change directory permissions in Linux, use the following:
chmod +rwx filename to add permissions
chmod -rwx directoryname to remove permissions.
chmod +x filename to allow executable permissions.
chmod -wx filename to take out write and executable permissions.
Note that โrโ is for read, โwโ is for write, and โxโ is for execute.
This only changes the permissions for the owner of the file.
To check which commands you have run till now.
history
To remove a directory/ Folder.
rm filename
-
To create a fruits.txt file and to view the content.
vim fruits.txt
cat fruits.txt
To Show only top three fruits from the file
head -3 <filemane>
To Show only bottom three fruits from the file.
tail -3 <filemane>
To find the difference between fruits.txt and Colors.txt file.
diff
fruits.txt colors.txt