pi@raspberrypi:~ $ cd..
pi@raspberrypi:/home $ cd..
You could also get there with the absolute path/ :
pi@raspberrypi:~ $ cd /
Once you’ve changed to a directory, use the ls command to list the
files there:
pi@raspberrypi:/ $ ls
bin dev home lost+found mnt proc run selinux sys usr
boot etc lib media opt root sbin srv tmp var
Most commands have additional parameters, or
switches
, that can
be used to turn on different behaviors. For example, the -l switch
will produce a more detailed listing, showing file sizes, dates, and
permissions:
pi@raspberrypi:~ $ ls -l
total 8
drwxr-xr-x2pipi4096Oct1214:26Desktop
drwxrwxr-x2pipi4096Jul2014:07python_games
The -a switch will list all files, including invisible ones (invisible file
names begin with a dot):
pi@raspberrypi:~ $ ls -la
total 80
drwxr-xr-x 11 pi pi 4096 Oct 12 14:26
.
drwxr-xr-x 3 root root 4096 Sep 18 07:48 ..
-rw-------
1 pi pi 25 Sep 18 09:22 .bash_history
-rw-r--r--
1 pi pi 220 Sep 18 07:48 .bash_logout
-rw-r--r--
1 pi pi 3243 Sep 18 07:48 .bashrc
drwxr-xr-x
6 pi pi 4096 Sep 19 01:19 .cache
drwxr-xr-x
9 pi pi 4096 Oct 12 12:57 .cong
drwx------
3 pi pi 4096 Sep 18 09:24 .dbus
drwxr-xr-x
2 pi pi 4096 Oct 12 14:26 Desktop
-rw-r--r--
1 pi pi 36 Sep 18 09:35 .dmrc
drwx------
2 pi pi 4096 Sep 18 09:24 .gvfs
drwxr-xr-x
2 pi pi 4096 Oct 12 12:53 .idlerc
-rw-------
1 pi pi 35 Sep 18 12:11 .lesshst
drwx------
3 pi pi 4096 Sep 19 01:19 .local
-rw-r--r--
1 pi pi 675 Sep 18 07:48 .prole
drwxrwxr-x
2 pi pi 4096 Jul 20 14:07 python_games
drwx------
4 pi pi 4096 Oct 12 12:57 .thumbnails
-rw-------
1 pi pi 56 Sep 18 09:35 .Xauthority
-rw-------
1 pi pi 300 Oct 12 12:57 .xsession-errors
-rw-------
1 pi pi 1391 Sep 18 09:35 .xsession-errors.old
Getting Around Linux on the Raspberry Pi 37
GSW_RASPI_4ED_FIN.indd 37GSW_RASPI_4ED_FIN.indd 37 10/28/21 10:53 AM10/28/21 10:53 AM