I've compiled some of the common linux/unix shell commands. I believe this will be a great jumpstart for all *nix lovers like me.
ex. if you're in /root
cd ~ : directs you to your home directory (/home)
cat filename.txt - this prints the contents of the file filename.txt to your screen
ex.
[root@localhost var]# ls -al
chmod : changes the permissions of a particular file/directory.
USER - GROUP - EVERYONE
ex.
chmod 755 filename - gives read,write and execute permissions on the USER and read and execute permissions only to the Group and Everyone. This will look like:
USER GROUP
Syntax:
chown owner.owner filename - this sets the owner of the user and group to "owner"
chown apache:apache filename
The output would be:
From
drwxr-xr-x 3 root root 4096 Sep 5 2007 filename
It will be
drwxr-xr-x 3 apache apache 4096 Sep 5 2007 filename
-a, display an entry for each file (and not directory) contained in the
current directory
-H, calculate disk usage for link references specified on the command line
-k, show sizes as multiples of 1024 bytes, not 512-byte
-L, calculate disk usage for link references anywhere
-s, report only the sum of the usage in the current directory, not for each
file
-x, only traverse files and directories on the device on which the pathname
argument is specified.
-h, show filesize in nice human readable format.
0 comments
Post a Comment