Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1: Is there a difference between running ls versus ls -al?

Expand
titleAnswer

Yes. The ls command is used to list files.

The characters after the '-' are flags, which select options associated with the command.

Code Block
[arcc-t05@blog1 ~]$ ls
Desktop  Documents  Downloads
[arcc-t05@blog1 ~]$ ls -al
total 76
drwxr-x---   8 arcc-t05 arcc-t05  4096 Oct  3 13:57 .
drwxr-xr-x 925 root     root     32768 Sep 27 16:21 ..
-rw-------   1 arcc-t05 arcc-t05   212 Sep 12 15:44 .bash_history
-rw-r--r--   1 arcc-t05 arcc-t05    18 Aug 10 17:00 .bash_logout
-rw-r--r--   1 arcc-t05 arcc-t05   141 Aug 10 17:00 .bash_profile
-rw-r--r--   1 arcc-t05 arcc-t05   376 Aug 10 17:00 .bashrc
drwx------   3 arcc-t05 arcc-t05  4096 Sep 12 11:36 .config
drwxr-xr-x   2 arcc-t05 arcc-t05  4096 Aug 10 17:00 Desktop
drwxr-xr-x   2 arcc-t05 arcc-t05  4096 Aug 10 17:00 Documents

...

Answers(2)

2: How can would you find out what the –al options do?

Expand
titleAnswer
  • Use man ls or ls --help

    • -a

...

    • is to specify “all”, which will include hidden files.

    • -l is to specify “long” which gives us the “long format” output about the listed files.

  • Options are also case sensitive:

    Code Block
    [arcc-t05@blog1 ~]$ ls -A
    .bash_history  .bash_profile  .config  Documents  .emacs     .kshrc    .mozilla  .zshrc
    .bash_logout   .bashrc        Desktop  Downloads  .esd_auth  .lesshst  .ssh

...

Answers(3, 4)

3: What does the pwd command do?

Expand
titleAnswer
  • Use man pwd or pwd --help

  • pwd - print name of current/working directory

4: From the command line, what happens if you press the up/down arrow keys?

Expand
titleAnswer

Steps through the previous commands you’ve typed. What do you find?

This should access your previous commands. Hitting the up arrow once will give you the last command you typed in. Pressing it over again will produce the command that preceded that one, and so on.

...

 Next Steps

...