UNIX tutorial
-
Upload
er-arvind-kumar -
Category
Documents
-
view
4 -
download
1
description
Transcript of UNIX tutorial
Utility Use-Casessudo Run as administratorman Manual / Help filesu Switch Userservice start a serviceservice stop a serviceservice restart a serviceservice start stop restart vsftpdtop CPU / Memory / Process detailstop Kill a rogue process mount mount a cdromumount un mount a cdromfdisk list the filesystem detailsfdisk work on a DISKfsck File System Check Utility - Check partitionmkfs Format a partitiondf Disk Filesystem Usage: (human readable form)du Disk Usage: List size of All files/folders beneathdu Disk Usage: List sizes UPTO 1 levelumask display default permission set in /etc/profileexit logout of current userpasswd change passwordrpm install a standalone rpm packagerpm upgrade a standalone rpm packagerpm remove a standalone rpm packagerpm list packages installed on systemyum installyum upgradeyum removeyum list packages that need updatesyum list packages available from sourcesyum list packages installed on systemup2date installup2date upgradeup2date removeup2date list packages that need updatesup2date list package available form sourcesup2date install with dependency solvedvsftpd enable user access on FTP server /etc/vsftpd.confvsftpd enable upload access on FTP /etc/vsftpd.confvsftpd restart vsftpd serverlsof List of opened files - which process -> which filelsof List of files opened by a process (eg. Dropbox)
tar backup a directory into a tarball(compressed)tar backup a directory (excluding some files)tar restore backup (to another directory preferably)crontab Edit the crontab file - /etc/crontab.confuseradd Create a new user 'arvind'passwd unlock the new user 'arvind'useradd create a user with DIFFERENT HOME Dir.useradd Create user with specific UID and GUIDuseradd Create user with multiple groupsuseradd Create user with account expiry datechage Verify the age of an accountuseradd Create user with password expiry dateuseradd Create user with specific SHELL
Commandsudo rpm -i vsftpdman ping
sudo /etc/init.d/apache2 startsudo /etc/init.d/apache2 stopsudo /etc/init.d/apache2 restartsudo service vsftpd restartsudo toprun top, press 'k' and enter the PIDmount -t iso9660 /dev/cdrom /mnt/cdromumount /mnt/cdrom or umount /dev/cdromfdisk -lfdisk /dev/sdafsck /dev/sda2mkfs -V -t vfat /dev/sda2df -hdu -hdu --max-depth=1 -humask -Sexitpasswdsudo rpm -ivh package.rpmsudo rpm -Uvh package.rpmsudo rpm -e packagesudo rpm -qayum install packageyum update packageyum remove packageyum list updatesyum list availableyum list installedup2date -i packageup2date -u package
up2date -lup2date --show-availableup2date --solvedeps=packagelocal_enable=yeswrite_enable=yessudo service vsftpd restartlsoflsof -i -n -P | grep dropbox
sudo crontab -euseradd arvindpasswd arvinduseradd -d /data/projects arvinduseradd -u 1000 -g 501 arvinduseradd -G admins,webadmin,developers arvinduseradd -e 2015-04-30 aparnachage -l aparnauseradd -f 45 arvinduseradd -s /sbin/csh techmahindra
tar -cvpzf wwwbackup.tar.gz /var/www
tar -cvpzf rootbackup.tar.gz --exclude=/mnt /
tar -xvpzf wwwbackup.tar.gz -C /var/recovery
Comments
use 'q' to exit a man page
CAUTION: partition should be unmounted
beneath pwd
p is very imp. Preserving permissions
# mm hh DoM M DoW cmduser arvind in locked stateunlocks and prompts your for new password
value of 0 will inactive the account as soon as password in expired