Versions Compared

Key

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

...

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

...

02.12 12a Answers

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

  • Use man ls or ls --help

  • -a, --all do not ignore entries starting with .

  • -l use a long listing format

  • 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  .sshWhat does the pwd command do?

...

02.12b Answers

3: What does the pwd command do?

...

Code Block
[folder01]$ mkdir folder02
[folder01]$ ls
folder02

[folder01]$ cd folder02/
[folder02]$ pwd
/home/arcc-t05/folder01/folder02

[folder02]$ cd ../..
[~]$ pwd
/home/arcc-t05

...

03.16 16a mv: Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

Code Block
$ cd
# Create an empty file.
[~]$ touch myfil.txt
[~]$ ls
Desktop  Documents  Downloads  folder01  myfil.txt

# Rename the file ‘myfil.txt’ to ‘myfile.txt’:
[~]$ mv myfil.txt myfile.txt 
[~]$ ls
Desktop  Documents  Downloads  folder01  myfile.txt

...

03.16b mv: Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

Code Block
# Move the file ‘myfile.txt’ into the directory ‘folder01’
[~]$ mv myfile.txt folder01/

[~]$ ls
Desktop  Documents  Downloads  folder01

# We can ‘ls’ what is in a relative folder.
[~]$ ls folder01/
folder02  myfile.txt

...