Linux

  1. How do you open a file in Vi?
    Run the Vi filename command
  2. How do you search in Vi?
    backslash followed by search item
  3. How do you save changes in Vi?
    To save your changes use the w command
  4. How do you quit from Vi?
    To quit use the :q command
  5. How do you save and quit a file in Vi?
    Use the :wq command
  6. How do you abandon any changes you've made in Vi?
    Use the :q! command
  7. How do you edit a file in Vi?
    • x deletes the currently selected character.
    • dw deletes the currently selected word.
    • dd deletes the currently selected line.
    • p places text from a buffer.
    • u restores text from a previous change.
  8. How do u insert text into a file in Vi?
    • i inserts text at the current position of the editor.
    • o opens up a new line below the current position of the cursor.
  9. How do you get out of insert mode and back into command mode in Vi?
    Use esc key.
  10. What is vipw used to edit?
    It is used to edit the /etc/passwd file.
  11. What is the vigw file used to edit?
    It is used to edit the /etc/group file.
  12. What is the visudo command used for?
    It is used to edit the /ect/sudoers file.
  13. What is in the / directory?
    This is the root directory the top level directory in FHS all other directory's are subdirectory's of the root.
  14. What is in the /bin directory?
    Essential command line utilities.
  15. What is in the /boot directory?
    Includes linux startup files including the linux kernel.
  16. What is in the /dev directory?
    Hardware and software device drivers.
  17. What is in the /ect directory?
    Basic configuration files.
  18. What is in the /home directory?
    Home directories for all users.
  19. What is in the /lib directory?
    Program libraries for the kernel and various command line utilities.
  20. What is in the /media directory?
    The mount point for removal media including floppy drives dvd's ect
  21. What is in the /misc directory?
    The standard mount point for local directories
  22. What is in the /mnt directory?
    A legacy mount point.
  23. What is in the /net directory?
    The standard mount for network directories
  24. What is in the /opt directory?
    Common location for third party applications.
  25. What is in the /proc directory?
    Currently running kernel processes as well as kernell configuration settings such as IP forwarding.
  26. What is in the /root directory?
    The home directory of the root user.
  27. What is in the /sbin directory?
    Sytem administration commands.
  28. What is in the /selinux directory?
    Currently configured settings for security enhanced linux
  29. What is in the /smb directory?
    The standard mount point for remote shared microsoft directories mounted via the automounter.
  30. What is in the /srv directory?
    Used by network servers on non red-hat distributions.
  31. What is in the /tftpboot directory?
    Included if the tftp server is installed
  32. What is in the /tmp directory?
    Temperary files.
  33. What is in the /usr directory?
    Small programs accessible to all users.
  34. What is in the /var directory?
    Variable data including log files and printer spools
  35. What is shown in the /dev directory to represent a floppy drive?
    • First floppy device /dev/fd0
    • second floppy device /dev/fd1
  36. What is shown in the /dev directory to represent a PATA (IDE) drive?
    • First drive = /dev/hda
    • Second drive = /dev/hdb
  37. What is shown in the /dev directory to represent a SATA or SCSI drive?
    • First Device = /dev/sda
    • Second Device = /dev/sdb
  38. What is shown in the /dev directory to represent a Parallel port drive?
    • First device = /dev/pd1
    • First tape drive = /dev/pt1
  39. What is shown in the /dev directory to represent a usb drive?
    Various widely.
  40. What command do i use to view whats in the /dev directory?
    ls -l /dev | more
  41. What command would you use to partition a hard disk?
    • fdisk
    • fdisk /dev/sda
  42. What command would you use to format a linux partition?
    • mkfs
    • mkfs -t ext3 /dev/hda2
  43. What command would i use to check a filesystem in linux?
    • fsck
    • if you want to run the fsck command you have to unmount the filesystem first then run fsck then mount the drive again
    • eg. unmount /var
    • fsck -t ext3 /dev/hda7
    • mount /dev/hda7 /var
  44. What command can you use to find out what directory you are in?
    pwd
  45. What command can you use to change directory?
    cd
  46. What command can you use to list the files in the current directory?
    ls
Author
groper77
ID
13430
Card Set
Linux
Description
linux commands
Updated