Linux/Unix commands

Card Set Information

Author:
gamebooy2020
ID:
171875
Filename:
Linux/Unix commands
Updated:
2012-09-25 21:54:26
Tags:
linux unix commands
Folders:

Description:
linux & unix commands
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user gamebooy2020 on FreezingBlue Flashcards. What would you like to do?


  1. what 2 linux commands are used to extract or archive packages?
    • bzip2
    • gzip
  2. what linux command is used to schedule a command to run at a later time?
    Crontab "file"

    • -l = display current crontab entries
    • -r = remove current crontab
    • -e = edit crontab
  3. what command can be used on windows, linux, and unix to change or view the host name of a client?
    hostname
  4. what command can be used to trace a path from one node to another on a network
    • traceroute (UNIX/ Linux)
    • tracert (Windows)
  5. What UNIX/Linux command can be used to display ip address, network interfaces, transferred & received data info & configure an interface?
    ifconfig [interface]

    • -interface = name of the interface (eth0)
    • - up = activates interface
    • - down = disables interface
    • - address = assigns an ip address
    • -netmask = sets subnet mask
  6. What UNIX / Linux command displays a systems's TCP /IP network routing table?
    netstat -r 
  7. Name the most comon UNIX /Linux file & directory structure and describe what each directory contains/does.
    • /boot = contains kernel & system initialization files
    • /bin & /sbin = applications & services
    • /var = holds variable data (log files, email, print jobs)
    • /home - stores user account info
  8. what UNIX/Linux command is used to kill a process?
    Kill [process id]

    • - to find process id, use ps to list the running programs
    • -use killal to kill a program by name
  9. what command can be used to change user ownership of a file in UNIX/linux?
    Chown "username""file"

    -r = recursively changes ownership
  10. What Linux command is used to print kernel & driver messages?
    dmesg
  11. what linux command can be used to display free disk space?  what command can be used to display used disk space?
    • 1.) df
    • 2.) du
  12. what 2 commands are used to disable & enable a network interface, respectively?
    • 1.) ifdown
    • 2.) ifup
  13. what command is used to unmount a filesystem in Linux?
    unmount
  14. what command can be used to run a command as another user in linux?
    sudo

    -u "user" - run command as specified user (runs as root if not specified).  user #uid to specify userid.

    -H = set home environment varibable to target user specified.
  15. what linux command is used to modify passwords in linux?
    passwd "username"

    -d = delete
  16. What Linux command allows one user to become another user?
    SU "username"

    - if username is not specified, default user is root.
  17. What UNIX/Linux command can be used to display a manual for the command "command"
    man "command"
  18. How can you connect a linux/unix machine to a windows share named "download" ?
    mount -t cifs //ntserver/download -o username = "user",password="password" /mnt/server

    • -o=options passed to mount command
    • /mnt/server=mount point to acess share
  19. What linux command can be used to add, delete, & list all the services on a computer?
    Chkconfig

    • - add "name" - add service
    • - del "name" - delete service
    • - list - list all services & whether they are running or not.
  20. What command in windows, Linux, & UNIX can be used to view, edit, routing table & routes?
    Route
  21. What UNIX/Linux command is used to add a new user account to a system?  What can be used to add a new group?
    • adduser
    • addgroup
  22. What command is used to delete a file? (UNIX/Linux)

    What switch allows you to delete files recursively?
    rm "file"

    -r can be used to remove contents of directories recursively
  23. What command is used to mount a device or file system to a computer in linux?
    mount -t "filesystem" "partition/device" "mountpoint"

    • -a = mount all filesystems
    • -r = mount as read only 
    • -L = "label" - mount the partition with the specified label
    • -U "uuid" - mount partition with specified uuid
  24. What UNIX/Linux command can be used to make a directory & what can be used to remove a directory?
    • Mkdir "dir"
    • Rmdir "dir"
  25. What command is used to edit a text file in UNIX/Linux?
    vi

    • :w "file"- save changes, specify filename to save to new file
    • :q - quit
    • Switch to command mode[ESC]
    • :## - Go to line number ##
    • :wq or :zz - Save changes and quit
    • :q! - Quit without saving
  26. What command is used to print a file?
    Lpr "name"
  27. What command (UNIX/Linux) can be used to search for the word "hack" in the file "trojan.doc"
    grep "hack" "trojan.doc"

     - the file searched can also be a directory
  28. What UNIX command can be used to sort the contents of a file?
    Sort "filename"
  29. What UNIX command displays the current date & time?
    Date
  30. What UNIX command can be used to list all files in a directory with details?
    ls -la

    • -l = use a long listing format
    • -a = Do not hide entries starting with .
  31. What command (UNIX) is used to display a list of all running programs?
    ps -ef

    • -e = select all processes
    • -f = full listing
    • -A = select all processes (includes those from other users)
  32. What command is used in Linux to search for & install software packages?
    apt-get or aptitude

    • -d = download only 
    • -q = quiet
    • -y = automatic yes to prompts
    • -b = compile source packages after download
    • -update = check for updates for packages
    • -upgrade = install newest versions of packages
    • -install / remove = install or remove a package
  33. What UNIX command can be used to change group ownership of a file?
    Chgrp "group" "file"

    -r = recursively changes group ownership of subfiles & directories
  34. What UNIX/Linux command can be used to change access privileges of a file so that the owner can read, write & execute it, so members of a group can read & execute, & non-members can read it?
    Chmod 754

    • first digit = owner
    • second digit = group
    • third digit = others

    1 = execute, 2 = write, 4 = read

    to add multiple priviledges, add the privileges together.
  35. What command (UNIX) can be used to search for the file "text.doc" in directory "/home/documents" & displays a path to the filename?
    Find "/home/documents" -iname "text.doc"

    • -name - search for files with the following name
    • -iname - search for files with the following name, not case sensitive
  36. What UNIX/Linux command is used to display a list of users currently logged on?
    Who
  37. What UNIX/Linux command can be used to move or rename a file?
    mv "file1" "file2"
  38. What UNIX/Linux command can be used to copy a file named "tuna.doc" to a new file named "fish.doc"?
    cp "tuna.doc" "fish.doc"
  39. What UNIX/Linux command is used to change directory?
    Cd
  40. what 2 commands can be used to display the current user id & name? (in UNIX/Linux)?
    • Who -m
    • Whoami
  41. What UNIX command is used to display the contents of a file?
    Cat "file"
  42. What command (Linux) is used to retrieve files via HTTP/FTP?
    Wget "url"
  43. What command can be used to perform reverse lookup on an ipaddress in linux?
    nslookup "ip address"
  44. What UNIX/Linux command can be used to show network status, address resolution (arp) tables, & routing tables?
    netstat

    • -p = shows ARP tables
    • -r = shows routing tables
    • -D = show status of DHCP configured devices
  45. What command can be used to list all partitions detected by linux?
    fdisk -l

What would you like to do?

Home > Flashcards > Print Preview