- cd
- ls
- mkdir
- cp
- mount /dev/md1 /mnt/jasondrive
- umount /mnt/md1
- mv
- nano (editor)
- rm -r images/ (recursive)
- locate
- updatedb
- man ls (display information on the command ls)
- useradd --shell /sbin/nologin tomcat6 (or just edit /etc/passwd file)
- useradd --shell /sbin/nologin --home-dir /usr/local/tomcat6 tomcat6
- usermod --append --groups groupname username
- groupadd groupname (or just edit /etc/group file)
- groupmod
- groupdel
- tar czvf archive.tar.gz [file1 file2...]
- tar cjvf archive.tar.bz2 [file1 file2...]
- su (substitute user)
- su - root
- sudo (execute a command with the specified account)
- /etc/sudoers (this file lists all users that are allowed to use sudo and the commands that are allowed to be executed)
- visudo
- df -h (disk free)
- free (displays the current system memory usage)
- yum install package
- chmod who+/-what filename
- chmod +x script.sh (make script.sh executable)
- chmod go-rwx photo.jpg (g: group, o:others, a:all, u:user/owner) no one can access the photo other than the owner.
- chown user filename
- chgrp group filename
- chown jason photo.jpg (the new owner of photo.jpg is the user "jason"
Execute:
- ./my-app (forces shell to look for files in the current working directory only)
- /home/jason/programs/my-app
- my-app (if /home/jason/programs is in the PATH)
System services:
- /etc/init.d/name command
- start / stop / restart / reload / status
Process management:
- ps aux (lists all processes)
- ps aux | grep gcpmain
- top
- kill pid (kill 12075)
- kill -9 pid
Directory
- /bin (common exe)
- /boot (critical files used at boot time)
- /dev (device and special files)
- /etc (system-wide config files)
- /home
- /lib (system-wide shared libraries and kernel modules)
- /media (list mount points for devices such as USB devices)
- /mnt (temporarily mounted filesystems
- /opt (optional software packages)
- /proc (kernel and process information virtual file system)
- /root (root user home directory)
- /sbin (system binaries dedicated to system admin)
- /srv (service data)
- /tmp (temporary files)
- /usr (read-only user data)
- /var (files that are expected to be modified by running apps)
- /dev/null
- /dev/random (random number generators)
- /dev/urandom (streams that generate flows of random numbers)
- /dev/full (pseudo device is a stream that returns an error when written to and is always considered full)
- /dev/zero (always considered empty)
No comments:
Post a Comment