Menu

  • Adduser

    • adduser - create a new user or update default new user information
      [SYNOPSIS] adduser OPTION USER
      option
      --homehome directory for the new user account
      --shellthe login shell for the new user account
      --no-create-homewith no home directory
      --uidforce use the UID for the new user account
      --gidforce use GROUP for the new user account
  • Change

    • chage - change user password expiry information
      [SYNOPSIS] chage OPTION USER
      option
      -lshow account aging information
      -M daysset maximim number of days before password change to MAX_DAYS
      -m daysset minimum number of days before password change to MIN_DAYS
      -W daysset expiration warning days to WARN_DAYS
      -I daysset password inactive after expiration to INACTIVE
  • Crontab

    • crontab - maintain crontab files for individual users
      option
      -eedit user's crontab
      -llist user's crontab
      -rdelete user's crontab
  • dmesg

    • dmesg
      print or control the kernel ring buffer
  • exit

    • exit - exit shell
  • fmt

    • fmt - simple optimal text formatter
      [SYNOPSIS] fmt OPTION FILE
      option
      -w WIDTHmaximum line width (default of 75 columns)
  • groupadd

    • groupadd - create a new group
      [SYNOPSIS] groupadd OPTION GROUP
      option
      -guse GID for the new group
      # groupadd -g 510 group

  • head

    • head - output the first part of files
      [SYNOPSIS] head OPTION FILE
      option
      no option (default)Print the first 10 lines
      -NPrint the N lines
      # head -20 file

  • ifconfig

    • ifconfig - configure a network interface
      [SYNOPSIS] ifconfig INTERFACE ADDRESS
      show status of active interfaces
      # ifconfig
      enable an interfce
      # ifconfig eth0 up
      disable an interface
      # ifconfig eth0 down
      change IP address of an interface
      # ifconfig eth0 192.168.0.10
      change subnet-mask of an interface
      # ifconfig eth0 netmask 255.255.255.248

  • localectl

    • localectl - Query or change system locale and keyboard settings.
      [SYNOPSIS] localectl {OPTIONS} {COMMAND}
      OPTIONS
      --privilegedAcquire privileges before execution
      --no-pagerDo not pipe output into a pager
      --host=[USER@]HOSTOperate on remote host

      COMMAND
      statusShow current locale settings
      set-locale LOCALESet system locale
      list-localesShow known locales
      set-keymap MAPSet virtual console keyboard mapping
      list-keymapsShow known virtual console keyboard mappings
      set-x11-keymap LAYOUTSet X11 keyboard mapping
      list-x11-keymap-layoutsShow known X11 keyboard mapping layouts
      list-x11-keymap-modelsShow known X11 keyboard mapping models
  • man

    • man - format and display the on-line manual pages
      [SYNOPSIS] man COMMAND
  • mv

    • mv - move (rename) files
      [SYNOPSIS] mv OPTION SOURCE DEST
      option
      -iprompt before overwrite
      # mv -i file /etc
      -fdo not prompt before overwriting
      # mv -f file /etc
      -blike --backup but does not accept an argument
      # mv -b file /etc
      -umove only when the SOURCE file is newer than the destination file or when the destination file is missing
      # mv -u file /etc

  • paste

    • paste - merge lines of files
      [SYNOPSIS] paste OPTION FILE1 FILE2
      option
      -dreuse characters from LIST instead of TABs
  • reboot

    • reboot - reboot the system
  • rpmbuild

    • rpmbuild - Build RPM Package
      [SYNOPSIS] rpmbuild OPTION SPEC-FILE/SRPM-FILE
      option
      -baBuild binary and source packages (after doing the %prep, %build, and %install stages)
      -bbBuild a binary package (after doing the %prep, %build, and %install stages)
      -bsBuild just the source package
      -bpExecutes the "%prep" stage from the spec file. Normally this involves unpacking the sources and applying any patches
      -bcDo the "%build" stage from the spec file (after doing the %prep stage). This generally involves the equivalent of a "make"
      -biDo the "%install" stage from the spec file (after doing the %prep and %build stages)
  • sort

    • sort - sort lines of text files
      [SYNOPSIS] sort OPTION FILE
      option
      -o FILEwrite result to FILE instead of standard output
      -ffold lower case to upper case characters
      -rreverse the result of comparisons
      -ncompare according to string numerical value
      -k --key=POS1[,POS2]start a key at POS1, end it at POS2 (origin 1)
      -t --field-separator=SEPuse SEP instead of non-blank to blank transition
  • sysctl

    • sysctl - configure kernel parameters at runtime
      [SYNOPSIS] sysctl OPTION
      option
      -aDisplay all values currently available. Please see the NOTES
      -pLoad in sysctl settings from the file specified or /etc/sysctl.conf if none given
  • timedatectl

    • timedatectl - Query or change system time and date settings.[SYNOPSIS] timedatectl {OPTIONS} {COMMAND}
      OPTIONS
      --privilegedAcquire privileges before execution
      --no-pagerDo not pipe output into a pager
      --host=[USER@]HOSTOperate on remote host

      COMMAND
      statusShow current time settings
      set-time TIMESet system time
      set-timezone ZONESet system timezone
      list-timezonesShow known timezones
  • userdel

    • userdel - delete a user account and related files
      [SYNOPSIS] userdel OPTION USER
      option
      -rremove home directory and mail spool
  • which

    • which - shows the full path of (shell) commands
      [SYNOPSIS] which COMMAND
  • zypper

    • zypper - command-line interface to ZYPP system management library
      [SYNOPSIS] zypper OPTION1 COMMAND OPTION2 PACKAGE
      command
      installInstall packages or resolvables
      # zypper install package
      updateUpdate packages
      # zypper update package
      removeRemove packages or resolvables
      # zypper remove package
      searchSearch for packages matching a pattern
      # zypper search keyword
      source-installInstall source packages
      # zypper source-install package

  • alias

    • alias - aliases file for sendmail
      [SYNOPSIS] alias (alias name)
      # alias
      ⇒ show all alias
      # alias la='ls -a'
      ⇒ show all alias for ls command

  • chgrp

    • chgrp - change group ownership
      [SYNOPSIS] chgrp OPTION GROUP FILE/DIRECTORY
      option
      -Roperate on files and directories recursively
      # chgrp -R user dir

  • cut

    • cut - remove sections from each line of files
      [SYNOPSIS] cut OPTION FILE
      option
      -cselect only these characters
      -duse DELIM instead of TAB for field delimiter
      -fselect only these fields; also print any line that contains no delimiter character, unless the -s option is specified
  • dnf

    • dnf - Package manager for RPM
      [SYNOPSIS] dnf OPTION COMMAND PACKAGE
      command
      installInstall a package or packages on your system
      # dnf install package
      reinstallreinstall a package
      upgradeUpgrade a package or packages on your system
      # dnf upgrade package
      upgrade-toUpgrade a package on your system to the specified version
      removeRemove a package or packages from your system
      # dnf remove package
      groupDisplay, or use, the groups information
      listList a package or groups of packages
      check-updateCheck for available package upgrades
      infoDisplay details about a package or group of packages
      providesFind what package provides the given value
      searchSearch package details for the given string
      # dnf search keyword
      historyDisplay, or use, the transaction history
      updateinfoDisplay advisories about packages

      option
      -yanswer yes for all questions
      # dnf -y install package
      --enablerepo=repoenable one or more repositories (wildcards allowed)
      # dnf --enablerepo=repo install package
      --disablerepo=repodisable one or more repositories (wildcards allowed)
      # dnf --disablerepo=repo install package
      --installroot [path]set install root
      --exclude=packageexclude packages by name or glob
      # dnf --exclude=package update
      --releasever RELEASEVERoverride the value of $releasever in config and repo files
      --nopluginsdisable all plugins
      # dnf --noplugins update

  • expand

    • expand - convert tabs to spaces
      [SYNOPSIS] expand OPTION FILE
      option
      -ido not convert tabs after non blanks
      -t [tabs NUMBER]have tabs NUMBER characters apart, not 8
  • free

    • free - Display amount of free and used memory in the system
      [SYNOPSIS] free OPTION
      option
      -mswitch displays it in megabytes
      -kswitch displays it in kilobytes
      -bswitch displays it in bytes
      -s secondswitch activates continuous polling delay seconds apart
      # free -s 3

  • groupdel

    • groupdel - remove a group
      [SYNOPSIS] groupdel GROUP
  • history

    • history - list histories of commands
  • insmod

    • insmod - simple program to insert a module into the Linux Kernel
      [SYNOPSIS] insmod OPTION MODULE
      option
      -soutput rusults to syslog
      -vshow verbose
  • locate

    • locate - find files by name
      [SYNOPSIS] locate FILE
      Use updatedb if update locate database
  • mkdir

    • mkdir - make directories
      [SYNOPSIS] mkdir OPTION DIRECTORY
      option
      -pno error if existing, make parent directories as needed
      # mkdir /home/dir1/dir2
      -mset permission mode (as in chmod), not rwxrwxrwx - umask
      # mkdir -m 700 dir

  • netstat

    • netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multi-cast memberships
      [SYNOPSIS] netstat OPTION
      option
      -aShow both listening and non-listening sockets
      -rshow routing table
      -ishow interface's tables
      -lShow only listening sockets
      -ndon't resolve names
      -pShow the PID and name of the program to which each socket belongs
      -vshow verbose
      -eDisplay additional information
      -gdisplay multicast group memberships
      -sdisplay networking statistics (like SNMP)
      -odisplay timers
      -ccontinuous listing
      -Mdisplay masqueraded connections
      -Fdisplay Forwarding Information Base (default)
      -Cdisplay routing cache instead of FIB
  • ping

    • ping - send ICMP ECHO_REQUEST to network hosts
      [SYNOPSIS] ping OPTION HOST
      option
      -c countStop after sending count ECHO_REQUEST packets
  • repquota

    • repquota - summarize quotas for a filesystem
      [SYNOPSIS] repquota OPTION FILE-SYSTEM
      option
      -aReport on all filesystems indicated in /etc/mtab to be read-write with quotas
      -vReport all quotas, even if there is no usage. Be also more verbose about quotafile information
      -uReport quotas for users. This is the default
      -gReport quotas for groups
      -sTry to report used space, number of used inodes and limits in more appropriate units than the default ones
  • rsync

    • rsync - faster, flexible replacement for rcp
      [SYNOPSIS] rsync OPTION SRC DEST
      option
      -vincrease verbosity
      -aarchive mode; same as -rlptgoD (no -H)
      -uskip files that are newer on the receiver
      -zcompress file data during the transfer
      --exclude=PATTERNexclude files matching PATTERN
      --deletedelete files that don’t exist on sender
      # rsync -av --exclude="tmp" /home/ /backup
  • source

    • source
      Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename
  • systemctl

    • systemctl - Query or send control commands to the systemd manager.
      [SYNOPSIS] systemctl OPTIONS COMMAND
      OPTIONS
      --allShow all units/properties, including dead/empty ones
      # systemctl --all
      --tList only units of a particular type
      # systemctl -t service

      COMMAND
      startStart (activate) one or more units
      # systemctl start sendmail.service
      stopStop (deactivate) one or more units
      # systemctl stop sendmail.service
      reloadReload one or more units
      # systemctl reload sendmail.service
      restartStart or restart one or more units
      # systemctl restart sendmail.service
      statusShow runtime status of one or more units
      # systemctl status sendmail.service
      enableEnable one or more unit files
      # systemctl enable sendmail.service
      disableDisable one or more unit files
      # systemctl disable sendmail.service

  • touch

    • touch - change file timestamps
      [SYNOPSIS] touch OPTION TIME FILE
      option
      -tuse [[CC]YY]MMDDhhmm[.ss] instead of current time
      # touch -t 200712312359.59 file
      -achange only the access time
      -mchange only the modification time
  • uname

    • uname - print system information
      [SYNOPSIS] uname OPTION
      option
      -nprint the network node hostname
      -sprint the kernel name
      -mprint the machine hardware name
      -pprint the processor type or "unknown"
      -rprint the kernel release
      -vprint the kernel version
      -aprint all information, in the following order, except omit -p and -i if unknown
  • usermod

    • usermod - modify a user account
      [SYNOPSIS] usermod OPTION USER
      option
      -dnew home directory for the user account
      -gforce use GROUP as new primary group
      -Gnew list of supplementary GROUPS
      -snew login shell for the user account
      -unew UID for the user account
      -Llock the user account
      -Uunlock the user account
  • xargs

    • xargs - build and execute command lines from standard input
      [SYNOPSIS] xargs OPTION COMMAND
  • aptitude

    • aptitude - high-level interface to the package manager
      [SYNOPSIS] aptitude OPTION COMMAND PACKAGE
      command
      installInstall/upgrade packages
      # aptitude install package
      removeRemove packages
      # aptitude remove package
      purgeRemove packages and their configuration files
      # aptitude purge package
      searchSearch for a package by name and/or expression
      showDisplay detailed information about a package
      changelogView a package's changelog
      updateDownload lists of new/upgradable packages
      safe-upgradePerform a safe upgrade
      full-upgradePerform an upgrade, possibly installing and removing packages
      downloadDownload the .deb file for a package
      reinstallDownload and (possibly) reinstall a currently installed package
      cleanErase downloaded package files
      forget-newForget what packages are "new"
      holdPlace packages on hold
      unholdCancel a hold command for a package
      markautoMark packages as having been automatically installed
      unmarkautoMark packages as having been manually installed
      forbid-versionForbid aptitude from upgrading to a specific package version.
      whyShow the manually installed packages that require a package, or why one or more packages would require the given package
      why-notShow the manually installed packages that lead to a conflict with the given package, or why one or more packages would lead to a conflict with the given package if installed

      option
      -yAssume that the answer to simple yes/no questions is 'yes'
      # aptitude -y install package
      -sSimulate actions, but do not actually perform them.
      -dOnly download packages, do not install or remove anything.
      -vDisplay extra information. (may be supplied multiple times)
      -qIn command-line mode, suppress the incremental progress indicators.
      -hHelp text
      -VShow which versions of packages are to be installed.
      -PAlways prompt for confirmation or actions
      -fAggressively try to fix broken packages.
      -DShow the dependencies of automatically changed packages.
      -ZShow the change in installed size of each package.
      -uDownload new package lists on startup.
      -iPerform an install run on startup.
  • chkconfig - updates and queries runlevel information for system services

    • [SYNOPSIS] chkconfig OPTION SERVICE
      option
      --listThis option lists all of the services which chkconfig knows about, and whether they are stopped or started in each runlevel. If name is specified, information in only display about service name.
      --levelSpecifies the run levels an operation should pertain to. It is given as a string of numbers from 0 to 6. For example, --level 35 specifies runlevels 3 and 5.

  • date - print or set the system date and time

    • [SYNOPSIS] date OPTION
      option
      -Routput date and time in RFC 2822 format
  • du - estimate file space usage

    • [SYNOPSIS] du OPTION DIRECTORY
      option
      -awrite counts for all files, not just directories
      -hprint sizes in human readable format (e.g., 1K 234M 2G)
      -sdisplay only a total for each argument
  • export - define $ENV

    • [SYNOPSIS] export $ENV
  • fsck - check and repair a Linux file system

    • [SYNOPSIS] fsck OPTION DEVICE
      option
      -nMake no changes to the filesystem
      -t fslistSpecifies the type(s) of file system to be checked
      # fsck -t vfat /dev/sda2

  • groupmod - modify a group definition on the system

    • [SYNOPSIS] groupmod OPTION GROUP
      option
      -nchange the name to NEW_GROUP
      # groupmod -n new_name group
      -gchange the group ID to GID
      # groupmod -g 600 group
  • hostname - display or set its hostname or NIS domain name

    • [SYNOPSIS] hostname OPTION
      option
      -dDisplay the name of the DNS domain
  • join - join lines of two files on a common field

    • [SYNOPSIS] join OPTION FILE1 FILE2
      option
      -jequivalent to ‘-1 FIELD -2 FIELD’
      -j 1join on this FIELD of file 1
      -j 2join on this FIELD of file 2
  • ls - list directory contents

    • [SYNOPSIS] ls OPTION FILE/DIRECTORY
      option
      -luse a long listing format
      -ado not ignore entries starting with
      -dlist directory entries instead of contents, and do not dereference symbolic links
      -rreverse order while sorting
      -tsort by modification time
      -Ssort by file size
      -Xsort alphabetically by entry extension
      -iwith -l, print the index number of each file
      -Rlist subdirectories recursively
      -Fappend indicator (one of */=>@|) to entries
  • mkfs - build a Linux file system

    • [SYNOPSIS] mkfs OPTION DEVICE
      option
      -cCheck the device for bad blocks before building the file system
      -tSpecifies the type of file system to be built
      # mkfs -t ext3 partition

  • newaliases

    • When changing /etc/aliases , enable the change with the command
  • pr - convert text files for printing

    • [SYNOPSIS] pr OPTION FILE
      option
      + FIRST_PAGEprinting with page FIRST_PAGE
      - COLUMNoutput COLUMN columns and print columns down, unless -a is used
      -w PAGE_WIDTHset page width to PAGE_WIDTH characters for multiple text-column output only, -s[char] turns off
  • rm - remove files or directories

    • [SYNOPSIS] rm OPTION FILE
      option
      -iprompt before any removal
      # rm -i file
      -fignore nonexistent files, never prompt
      # rm -f file
      -r(-R)remove directories and their contents recursively
      # rm -rf dir

  • setfacl - set file access control lists

    • Usage : setfacl option file
      Option
      -mmodify the current ACL(s) of file(s)
      -xremove entries from the ACL(s) of file(s)
      -bremove all extended ACL entries
      -Rrecurse into subdirectories
      -doperations apply to the default ACL
      -kremove the default ACL
      --restore=filerestore ACLs (inverse of `getfacl -R')
  • split - split a file into pieces

    • [SYNOPSIS] paste OPTION INPUT PREFIX
      option
      -l --lines=NUMBERput NUMBER lines per output file
  • sysv-rc-conf - Run-level configuration for SysV like init script links

    • [SYNOPSIS] sysv-rc-conf OPTION SERVICE
      option
      --listThis option will list all of the services and if they are stopped or started when entering each runlevel
      # sysv-rc-conf --list rsync
      --levelThe runlevels this operation will affect. levels can be any number from 0-9 or S
      # sysv-rc-conf --level 3 rsync off

  • uniq - report or omit repeated lines

    • [SYNOPSIS] uniq OPTION INPUT OUTPUT
      option
      -donly print duplicate lines
      -uonly print unique lines
  • vi - Use vi editor

    • [SYNOPSIS] vi FILE
      Switch Command mode/Input mode
      KeyDescription
      iinsert words on the Cursor position
      ainsert words after the Cursor position
      Iinsert words on the head of the line of Cursor position
      Ainsert words on the last of the line of Cursor position
      oinsert words on the empty line inserted that is after Cursor position
      Oinsert words on the empty line inserted that is before Cursor position
      [Esc]switch to command mode

      Save/Quit
      KeyDescription
      :wsave
      :w filesave as a file
      :qquit without saving(confirmed)
      :q!quit without saving(forcely)
      :wqsave and quit
      :eback to the last saved
      :nswitch to other file if some files are opened
      :r fileread content of a file on current line
      :n,mw filesave as a file from n line to m line
      :n,mw>>fileadd to a file from n line to m line

      Cursor operation
      KeyDescription
      h (or) [←]move to left
      l (or) [→]move to right
      k (or) [↑]move to above
      j (or) [↓]move to below
      wmove to the head of next word
      bmove to the head of previous word
      0move to the head of line
      $move to the last of line
      Gmove to the last line
      nGmove to n line
      Hmove to the head of current screen
      nHmove to n line on current screen
      Lmove to the last line on current screen
      nLmove to the line of "n"
      Mmove to the head line on current screen

      Scrolling operation
      KeyDescription
      [Ctrl] + fscroll down for a screen
      [Ctrl] + bscroll up for a screen
      [Ctrl] + dscroll down for half of a screen
      [Ctrl] + uscroll up for half of a screen

      Edit operation
      KeyDescription
      xdelete a word on cursor
      Xdelete a word before cursor
      yycopy the current line into the buffer
      y$copy from the cursor position to the end of the line into the buffer
      y0copy from the head of line to the cursor position into the buffer
      ywcopy a word on cursor into the buffer
      ppaste the contents of the buffer after the cursor position
      Ppaste the contents of the buffer before the cursor position
      dddelete the current line
      d$delete from the cursor position to the end of the line
      d0delete from the head of the line to the cursor position
      dwdelete from the head of the line to the next word
      ucancel the last operation
      Ucancel the last operation for a line

      Search operation
      KeyDescription
      / word [Enter]search a word from the head of a file to the end
      ? word [Enter]search a word from the end of a file to the head
      nsearch next after a result of searching
  • yast2

    • run YaST Control Center
  • autoconf - generate configure script

    • [SYNOPSIS] autoconf OPTION
      option
      -hHelp text
  • chmod - change file access permissions

    • [SYNOPSIS] chmod OPTION PERMISSIONS FILE/DIRECTORY
      option
      -Rchange files and directories recursively
      # chmod -R 700 /home

  • dd - convert and copy a file

    • [SYNOPSIS] dd OPTION
      option
      if=FILEread from FILE instead of stdin
      of=FILEwrite to FILE instead of stdout
      bs=BYTESforce ibs=BYTES and obs=BYTES
      count=BLOCKScopy only BLOCKS input blocks
      seek=BLOCKSskip BLOCKS obs-sized blocks at start of output
  • e2fsck - check a Linux ext2/ext3 file system

    • [SYNOPSIS] e2fsck OPTION DEVICE
      option
      -cCheck for bad blocks and add them to the badblock list
      -pAutomatic repair (no questions)
      -vBe verbose
      -yAssume "yes" to all questions
  • expr - evaluate expressions

    • [SYNOPSIS] expr ARG1 EXPRESSION ARG2
  • ftp - connect to a FTP server

    • [SYNOPSIS] ftp HOST
  • groups

    • print the groups a user is in
  • hostnamectl - Query or change system hostname.

    • [SYNOPSIS] hostnamectl {OPTIONS} {COMMAND}
      OPTIONS
      --transientOnly set transient hostname
      --privilegedAcquire privileges before execution
      --host=[USER@]HOSTOperate on remote host

      COMMAND
      statusShow current hostname settings
      set-hostname HOSTNAMESet system hostname
  • ldconfig

    • configure dynamic linker run time bindings
  • lsmod - program to show the status of modules in the Linux Kernel

    • [SYNOPSIS] lsmod
  • mkswap - set up a Linux swap area

    • [SYNOPSIS] mkswap DEVICE
  • newgrp - log in to a new group

    • [SYNOPSIS] newgrp GROUP
  • quota - display disk usage and limits

    • [SYNOPSIS] quota OPTION
      option
      By default only the user quotas are printed
      -qPrint a more terse message, containing only information on filesystems where usage is over quota
  • rmdir - remove empty directories

    • [SYNOPSIS] rmdir DIRECTORY

      note: Use "rm -rf" if directories are not empty
  • setup

    • setup devices and file systems, mount root file system
  • ss : display more TCP and state informations

    • [SYNOPSIS] ss [options] [ FILTER ]
      Options
      -h, --helpshow help
      -V, --versionoutput version information
      -n, --numericdon't resolve service names
      -r, --resolveresolve host names
      -a, --alldisplay all sockets
      -l, --listeningdisplay listening sockets
      -o, --optionsshow timer information
      -e, --extendedshow detailed socket information
      -m, --memoryshow socket memory usage
      -p, --processesshow process using socket
      -i, --infoshow internal TCP information
      -s, --summaryshow socket usage summary
      -b, --bpfbpf 
      -Z, --contextdisplay process SELinux security contexts
      -z, --contextsdisplay process and socket SELinux security contexts
      -4, --ipv4display only IP version 4 sockets
      -6, --ipv6display only IP version 6 sockets
      -t, --tcpdisplay only TCP sockets
      -u, --udpdisplay only UDP sockets
      -d, --dccpdisplay only DCCP sockets
      -w, --rawdisplay only RAW sockets
      -x, --unixdisplay only Unix domain sockets
      -f, --family=FAMILYdisplay sockets of type FAMILY
      -D, --diag=FILEDump raw information about TCP sockets to FILE
      -F, --filter=FILEread filter information from FILE
      FILTER := [ state TCP-STATE ] [ EXPRESSION ]
  • tac - concatenate and print files in reverse

    • [SYNOPSIS] tac FILE
  • traceroute - print the route packets trace to network host

    • [SYNOPSIS] traceroute OPTION HOST
  • unzip - list, test and extract compressed files in a ZIP archive

    • [SYNOPSIS] unzip OPTION FILE
      option
      -llist archive files (short format)
      -ttest archive files
      -zdisplay only the archive comment
  • visudo - edit the sudoers file

    • [SYNOPSIS] visudo OPTION
      option
      -cEnable check-only mode
      -f FILESpecify and alternate sudoers file location
      -qEnable quiet mode
      -sEnable strict checking of the sudoers file
  • ypcat - print values of all keys in a NIS database

    • [SYNOPSIS] ypcat OPTION MAP
      option
      # ypcat passwd
      ⇒ show passwd map on NIS database
      # ypcat hosts
      ⇒ show hosts map on NIS database
  • awk - awk is a pattern scanning and processing language

    • [SYNOPSIS] awk OPTION (file and so on)
      option
      -Fspecify field-separator
  • chown - change file owner and group

    • [SYNOPSIS] chown OPTION USER FILE/DIRECTORY
      option
      -Roperate on files and directories recursively
      # chown -R user dir

  • depmod - program to generate modules.dep and map files

    • [SYNOPSIS] depmod OPTION (MODULE)
      option
      -aProbe all modules. This option is enabled by default if no file names are given in the command-line.
  • echo - display a line of text

    • [SYNOPSIS] echo OPTION STRING
      option
      -ndo not output the trailing newline
      -eenable interpretation of backslash escapes
  • fdisk - Partition table manipulator for Linux

    • [SYNOPSIS] fdisk DEVICE
      operation
      mshow help
      pshow partition table
      ncreate a new partition
      dremove a partition
      tchange file-type
      qquit without saving
      wquit with saving
  • getfacl - get file access control lists

    • Usage : getfacl option file
      Option
      -adisplay the file access control list only
      -ddisplay the default access control list only
      -cdo not display the comment header
      -Rrecurse into subdirectories
  • gunzip - compress or expand files

    • [SYNOPSIS] gunzip OPTION FILE
      option
      -vVerbose. Display the name and percentage reduction for each file compressed or decompressed
  • htpasswd - Manage user files for basic authentication

    • [SYNOPSIS] htpasswd OPTION PASSWORDFILE USER PASSWORD
      option
      -cCreate the passwdfile. If passwdfile already exists, it is rewritten and truncated
      -bUse batch mode; i.e., get the password from the command line rather than prompting for it
      -nDisplay the results on standard output rather than updating a file
      -mUse MD5 encryption for passwords
      -dUse crypt() encryption for passwords (default)
      -sUse SHA encryption for passwords
      -pUse plaintext passwords
      -DDelete user
  • ldd - print shared library dependencies

    • [SYNOPSIS] ldd PROGRAM
  • lspci - list all PCI devices

    • lspci - list all PCI devices
  • modinfo - program to show information about a Linux Kernel module

    • [SYNOPSIS] modinfo OPTION MODULE
      option
      -ashow only author
      -dahow only description
      -nshow only file name
  • nl - number lines of files

    • [SYNOPSIS] nl OPTION FILE
      option
      -huse STYLE for numbering header lines
      -fuse STYLE for numbering footer lines
  • quotacheck - scan a filesystem for disk usage, create, check and repair quota files

    • [SYNOPSIS] quotacheck OPTION FILE-SYSTEM
      option
      -bForces quotacheck to make backups of the quota file before writing the new data
      -vquotacheck reports its operation as it progresses
      -dEnable debugging mode
      -uOnly user quotas listed in /etc/mtab or on the filesystems specified are to be checked
      -gOnly group quotas listed in /etc/mtab or on the filesystems specified are to be checked
      -cDon’t read existing quota files. Just perform a new scan and save it to disk
      -fForces checking and writing of new quota files on filesystems with quotas enabled
      -aCheck all mounted non-NFS filesystems in /etc/mtab
      -mDon’t try to remount filesystem read-only. See comment with option -M
      -MThis flag forces checking of filesystem in read-write mode if a remount fails
      -RWhen used together with the -a option, all filesystems except for the root filesystem are checked for quotas
  • rmmod - simple program to remove a module from the Linux Kernel

    • [SYNOPSIS] rmmod OPTION MODULE
      option
      -aremove all unused modules
      -ssays use syslog, not stderr
  • sfdisk - Partition table manipulator for Linux

    • [SYNOPSIS] sfdisk OPTION DEVICE
      option
      -lList the partitions of a device
  • startx

    • initialize an X session
  • tail - output the last part of files

    • [SYNOPSIS] tail OPTION FILE
      option
      (no option)output the last 10 lines (default)
      -n, --lines=Noutput the last N lines, instead of the last 10
      # tail -20 file

  • tune2fs - adjust tunable filesystem parameters on ext2/ext3 filesystems

    • [SYNOPSIS] tune2fs OPTION DEVICE
      option
      -LSet the volume label of the filesystem
      -jAdd an ext3 journal to the filesystem
  • update-rc.d - install and remove System-V style init script links

    • [SYNOPSIS] update-rc.d OPTION SERVICE ACTION
      action
      defaultsmake links to start the service in runlevels 2345 and to stop the service in runlevels 016
      # update-rc.d sshd defaults
      removeremove all links to start the service
      # update-rc.d sshd remove

      option
      -nDon't do anything, just show what we would do
      -fForce removal of symlinks
  • vncpasswd

    • set VNC password
  • yppasswd - change your password in the NIS database

    • yppasswd - change your password in the NIS database
  • cat - Concatenate FILE(s), or standard input, to standard output.

    • [SYNOPSIS] cat OPTION FILE
      option
      -nnumber all output lines
      -bnumber nonblank output lines
      -snever more than one single blank line
  • clear

    • clear the terminal screen
  • df - report file system disk space usage

    • [SYNOPSIS] df OPTION DIRECTORY
      option
      -hprint sizes in human readable format (e.g., 1K 234M 2G)
      -mprint sizes in M-bytes
      -kprint sizes in K-bytes
      -ilist inode information instead of block usage
  • edquota - edit user quotas

    • [SYNOPSIS] edquota OPTION USER/GROUP
      option
      -uEdit the user quota. This is the default.
      -gEdit the group quota.
      -tEdit the soft time limits for each filesystem.
      -f filesystemsPerform specified operations only for given filesystem (default is to perform operations for all filesystems with quota).
  • file - determine file type

    • [SYNOPSIS] file FILE
  • gpasswd - administer /etc/group and /etc/gshadow

    • [SYNOPSIS] gpasswd OPTION GROUP
      option
      -ASet the list of administrative users
      # gpasswd -A user group
      -aAdd the user to the named group
      # gpasswd -a user group
      -dRemove the user from the named group
      # gpasswd -d user group
      -rRemove the password from the named group
      # gpasswd -r group

  • gzip - compress or expand files

    • [SYNOPSIS] gzip OPTION FILE
      option
      -dDecompress
      -vVerbose
      -rTravel the directory structure recursively
  • hwclock - query and set the hardware clock (RTC)

    • [SYNOPSIS] hwclock OPTION
      option
      --systohcSet the Hardware Clock to the current System Time
  • less - opposite of more

    • [SYNOPSIS] less OPTION FILE
      option
      - NCauses a line number to be displayed at the beginning of each line in the display

      cpmmands
      keydescription
      [↓]Forward one line
      [↑]Backward one line
      [Space]Forward one window
      bBackward one window
      qquit
  • lvcreate - create a logical volume in an existing volume group

  • option
    -nGives the name for the new logical volume
    -LGives the size to allocate for the new logical volume
    # lvcreate -L 5G -n NAME VG
    -hShow helps
  • modprobe - program to add and remove modules from the Linux Kernel

    • [SYNOPSIS] modprobe OPTION MODULE
      option
      -aInsert all module names on the command line
      -lList all modules matching the given wildcard
      -rThis option causes modprobe to remove, rather than insert a module
  • ntpq - standard NTP query program

    • [SYNOPSIS] ntpq OPTION
      option
      -pPrint a list of the peers known to the server as well as a summary of their state
      -?show helps
      -!show helps with more details
      -vshow version info
      -iForce ntpq to operate in interactive mode
  • quotaoff - turn filesystem quotas on and off

    • [SYNOPSIS] quotaoff OPTION FILE-SYSTEM
      option
      -aAll automatically mounted (no noauto option) non-NFS filesystems in /etc/fstab with quotas will have their quotas turned on. This is normally used at boot time to enable quotas
      -vDisplay a message for each filesystem where quotas are turned on
      -uManipulate user quotas. This is the default
      -gManipulate group quotas
      -pInstead of turning quotas on just print state of quotas (ie. whether. quota is on or off)
  • rndc - name server control utility

    • [SYNOPSIS] rndc COMMAND
      command
      reloadreload config and zones
      # rndc reload
      statusshow status of a name server
      # rndc status
      retransfer zonetransfer zones
      # rndc retransfer zone
  • shutdown - bring the system down

    • [SYNOPSIS] shutdown OPTION TIME MESSAGE
      -hHalt or poweroff after shutdown
      # shutdown -h now
      -rReboot after shutdown
      # shutdown -r +10
      -fSkip fsck on reboot
      # shutdown -rf +20 "This System will shutdown soon"
      -kDon’t really shutdown; only send the warning messages to everybody
      # shutdown -k now
      -cCancel an already running shutdown
      # shutdown -c
  • su - run a shell with substitute user and group IDs

    • [SYNOPSIS] su [-] USER
      make the shell a login shell
      # su - user

  • tar - The GNU version of the tar archiving utility

    • [SYNOPSIS] tar OPTION FILE
      option
      fuse archive file or device ARCHIVE
      vverbosely list files processed
      xextract files from an archive
      # tar xvf file.tar
      zfilter the archive through gzip
      # tar zxvf file.tar.gz
      jfilter the archive through bzip2
      # tar jxvf file.tar.bz2
      ccreate a new archive
      # tar cvf file.tar file1 file2
      tlist the contents of an archive
      # tar tvf file.tar
      uonly append files newer than copy in archive
      # tar uvf file.tar file1
      --deletedelete from the archive (not on mag tapes!)
      # tar --delete -vf file.tar file1

  • umask

    • show umask
  • updatedb

    • update a database for mlocate
  • wc - print the number of newlines, words, and bytes in files

    • [SYNOPSIS] wc OPTION FILE
      option
      -cprint the byte counts
      -lprint the newline counts
      -wprint the word counts
  • ypwhich - return name of NIS server or map master

    • ypwhich - return name of NIS server or map master
  • cd - change directory

    • [SYNOPSIS] cd DIRECTORY
  • cp - copy files and directories

    • [SYNOPSIS] cp OPTION (SOURCE FILE/DIRECTORY] [DEST FILE/DIRECTORY]
      option
      -iprompt before overwrite
      # cp -i file /etc
      -fif an existing destination file cannot be opened, remove it and try again
      # cp -f file /etc
      -blike --backup but does not accept an argument
      # cp -b file /etc
      -ppreserve the specified attributes (default: mode,ownership,timestamps)
      # cp -p file /etc
      -r(R)copy directories recursively
      # cp -R dir /etc

  • dig - DNS lookup utility

    • [SYNOPSIS] dig OPTION (HOST NAME/IP ADDR)
      option
      typical invocation
      # dig yahoo.com
      -xreverse invocation
      # dig -x 111.222.333.444

  • ethtool - Display or change ethernet card settings

    • [SYNOPSIS] ethtool INTERFACE
  • find - search for files in a directory hierarchy

    • [SYNOPSIS] find PATH OPTION
      option
      -name PATTERNSearch from file name with the PATTERN
      # find ./ -name file.txt
      -perm PATTERNSearch from permissions with the PATTERN
      # find ./ -perm -o+x
      -size SIZESearch from file-size with the SIZE
      # find ./ -size 1140c
      -type TYPESearch from file-type with the TYPE
      # find ./ -type d
      -user USERSearch from owner with the USER
      # find ./ -user root
      -group GROUPSearch from group with the GROUP
      # find ./ -group root
      -exec COMMAND {} \;Execute command when matching
      # find ./ -size 1140c -exec cat {} \;
      -printlist search-result
      -fprint FILEprint the full file name into file file
      -lslist current file in ‘ls -dils’ format on standard output
      -nouserNo user corresponds to file’s numeric user ID
      -nogroupNo group corresponds to file’s numeric group ID
      -andSearch with "AND"
      -orSearch with "OR"
      -atime NFile was last accessed N*24 hours ago
      -mtime NFile’s data was last modified N*24 hours ago
      -ctime NFile’s status was last changed N*24 hours ago
      -newer FILEFile was modified more recently than file
      -links NFile has N links
  • grep - print lines matching a pattern

    • [SYNOPSIS] grep OPTION PATTERN FILE
      option
      -iIgnore case distinctions in both the PATTERN and the input files
      -nPrefix each line of output with the 1-based line number within its input file
      -vInvert the sense of matching, to select non-matching lines
      -wSelect only those lines containing matches that form whole words
      -r(R) dirRead all files under each directory, recursively; this is equivalent to the -d recurse option
      # grep -r 'word' dir

  • halt - stop the system

    • [SYNOPSIS] halt (-p)
  • id - Print information for USERNAME, or the current user.

    • [SYNOPSIS] id USER
  • ln - make links between files

    • [SYNOPSIS] ln OPTION TARGET LINK_NAME
      option
      -smake symbolic links instead of hard links
  • make - GNU make utility to maintain groups of programs

    • -fUse file as a makefile
      # make -f makefile
      -nDon't actually run any commands; just print them
  • mount - mount a file system

    • [SYNOPSIS] mount OPTION DEVICE MOUNT-POINT
      option
      -aMount all filesystems (of the given types) mentioned in fstab
      -tThe argument following the -t is used to indicate the file system type
      # mount -t nfs example.com:/home /mnt

  • passwd - update a user’s authentication tokens(s)

    • [SYNOPSIS] passwd OPTION USER
      option
      -dThis is a quick way to disable a password for an account
      # passwd -d user
      -lThis option is used to lock the specified account and it is available to root only
      # passwd -l user
      -uThis is the reverse of the -l option - it will unlock the account password by removing the ! prefix
      # passwd -u user
      -xThis will set the maximum password lifetime, in days, if the user’s account supports password life-times
      # passwd -x 10 user
      -nThis will set the minimum password lifetime, in days, if the user’s account supports password life-times. Available to root only
      # passwd -n 10 user
      -iThis will set the number of days which will pass before an expired password for this account will be taken to mean that the account is inactive and should be disabled, if the user’s account supports pass-word lifetimes
      # passwd -i 10 user
      -wThis will set the number of days in advance the user will begin receiving warnings that her password will expire, if the user’s account supports password lifetimes
      # passwd -w 10 user
      -SThis will output a short information about the status of the password for a given account
      # passwd -S user
         user PS 2009-09-12 0 99999 7 -1 (Password set, MD5 crypt.)

  • quotaon - turn filesystem quotas on and off

    • [SYNOPSIS] quotaon OPTION FILE-SYSTEM
      option
      -aAll automatically mounted (no noauto option) non-NFS filesystems in /etc/fstab with quotas will have their quotas turned on
      -vDisplay a message for each filesystem where quotas are turned on
      -uManipulate user quotas. This is the default
      -gManipulate group quotas
      -pInstead of turning quotas on just print state of quotas (ie. whether. quota is on or off)
      -fMake quotaon behave like being called as quotaoff
  • rpm - RPM Package Manager

    • [SYNOPSIS] rpm OPTION PACKAGE
      option
      -iThis installs a new package
      # rpm -i package
      -FThis will upgrade packages, but only if an earlier version currently exists
      # rpm -F package
      -UThis upgrades or installs the package currently installed to a newer version
      # rpm -U package
      -eerase (uninstall) package
      # rpm -e package
      -qquery packages
      # rpm -q package
      -Vverify installed packages
      # rpm -V package
      -Kverify package signature
      # rpm -K package
      --rebuilddbrebuild the database indices from the installed package headers
      # rpm --rebuilddb
      --initdbcreate a new database if one doesn’t already exist
      # rpm --initdb
      --importimport PUBKEY
      # rpm --import /usr/share/rhn/RPM-GPG-KEY
      options with i, U
      -vshow package name
      # rpm -iv package
      -hdisplay progress
      # rpm -ivh package
      -vvPrint lots of ugly debugging information
      # rpm -ivv package
      --nodepsDon’t do a dependency check before installing or upgrading a package
      # rpm -ivh --nodeps package
      --testDon’t really uninstall anything, just go through the motions
      # rpm -ivh --test package
      options with q
      -aQuery all installed packages
      # rpm -qa
      -iDisplay package information, including name, version, and description. This uses the --queryformat if one was specified
      # rpm -qi package
      -lList files in package
      # rpm -ql package
      -cList only configuration files (implies -l)
      # rpm -qc package
      -dList only documentation files (implies -l)
      # rpm -qd package
      -fQuery package owning FILE
      # rpm -qf /bin/bash
      -RList packages on which this package depends
      # rpm -qR package
      -sDisplay the states of files in the package (implies -l)
      # rpm -qs package
      --lastOrders the package listing by install time such that the latest packages are at the top
      # rpm -q --last package
      --changelogDisplay change information for the package
      # rpm -q --changelog package

  • smbpasswd - change a user’s SMB password

    • [SYNOPSIS] smbpasswd OPTION USER
      option
      -aadd user
      -eenable user
      -ddisable user
      -nset no password
      -xdelete user
      -hshow helps
      -c smb.conf fileUse the given path to the smb.conf file
      -r MACHINEspecify remote MACHINE
      -U USERspecify remote USER
  • sudo - sudoedit - execute a command as another user

    • [SYNOPSIS] sudo OPTION COMMAND
      option
      -u USERcauses sudo to run the specified command as a user other than root
      -sruns the shell specified by the SHELL environment variable if it is set or the shell as specified in passwd(5)
      -Hsets the HOME environment variable to the homedir of the target user (root by default) as specified in passwd(5)
      -lThe -l (list) option will list out the allowed (and forbidden) commands for the invoking user on the current host
      -hshow help
      -vsudo will update the user’s timestamp, prompting for the user’s password if necessary
      -kThe option to sudo invalidates the user’s timestamp by setting the time on it to the Epoch
      -KThe option is like -k except that it removes the user’s timestamp entirely
      -bThe option tells sudo to run the given command in the background
  • tasksel

    • install or remove packages
  • umount - unmount file systems

    • [SYNOPSIS] umount DEVICE
      # umount /mnt
      ⇒ unmount the device mounted on /mnt

  • useradd - create a new user or update default new user information

    • [SYNOPSIS] useradd OPTION USER
      option
      -sthe login shell for the new user account
      # useradd -s /sbin/nologin user
      -dhome directory for the new user account
      # useradd -d /home/user user
      -gforce use GROUP for the new user account
      # useradd -g group user
      -eset account expiration date to EXPIRE_DATE
      # useradd -e 20081231 user
      -uforce use the UID for the new user account
      # useradd -u 550 user
      -mcreate home directory for the new user account
      # useradd -m user
      -Mdo not create user's home directory(overrides /etc/login.defs)
      # useradd -M user

  • wget - The non-interactive network downloader

    • [SYNOPSIS] wget URL
      option
      -cresume getting a partially-downloaded file
  • yum - Yellowdog Updater Modified

    • [SYNOPSIS] yum OPTION COMMAND PACKAGE
      command
      installInstall a package or packages on your system
      # yum install package
      updateUpdate a package or packages on your system
      # yum update package
      removeRemove the packages
      # yum remove package
      groupinstallInstall the packages in a group on your system
      # yum groupinstall "X Window System"
      groupupdateUpdate the packages in a group on your system
      # yum groupupdate "X Window System"
      groupremoveRemove the packages in a group from your system
      # yum groupremove "X Window System"
      listList a package or groups of packages
      # yum list
      ⇒ display packages that is possible to install
      # yum list installed
      ⇒ display installed packages
      check-updateCheck for available package updates
      # yum check-update
      infoDisplay details about a package or group of packages
      # yum info package
      searchSearch package details for the given string
      # yum search keyword
      deplistList a package's dependencies
      # yum deplist package

      option
      -yanswer yes for all questions
      # yum -y install package
      --enablerepo=repoenable one or more repositories (wildcards allowed)
      # yum --enablerepo=repo install package
      --disablerepo=repodisable one or more repositories (wildcards allowed)
      # yum --disablerepo=repo install package
      --exclude=packageexclude package(s) by name or glob
      # yum --exclude=package update
      --nopluginsdisable Yum plugins
      # yum --noplugins update


  • www.hackthesec.co.in

0 comments:

Post a Comment

 
Top