Basic linux commands
Posted under » Linux on 30 September 2009
A lot of things cannot be done unless you are SUDO
sudo su -
Make directory
MKDIR newfile
Copy
Copies the contents of file1 into file2
cp file1 file2
Move
Also known as rename
mv file1 file2
Remove
The rm command deletes (removes) files and directories.
rm -r directory
If files.
rm file1 file2
Changing file ownership
chown you some_file
Please see mac version.
The group ownership of a file or directory
chgrp new_group some_file
CHMOD
chmod 600 some_file -R
- 600 - Only owner can read and write. The rest can't even read.
- 644 - Only owner can write.
- 664 - Most common. Owner and group can write
- 666 - Everyone has write permission
- 755 - Everyone can do anything they wish
PWD
Often it's useful to know your exact current directory. To find this out, type the command pwd (short for "print working directory")
find
find /usr -name 'file*' find -name 'bazaar' find -name bazaar
Find every file under the directory /usr starting in "file".
Can try also whereis.
If you want to look for old commands,
history | less
Last but not least... creating soft link or alias.
