Tuesday 15 September 2015

$ who
pi@raspberrypi ~ $ who
pi       pts/0        2015-09-15 02:46 (192.168.1.13)

Information: List username(s) that logged into rpi.

$ date
 pi@raspberrypi ~ $ date
Tue Sep 15 04:59:33 UTC 2015

Information:

$ who am i
pi@raspberrypi ~ $ who am i
pi       pts/0        2015-09-15 02:46 (192.168.1.13)

Information:

$ date; who
pi@raspberrypi ~ $ date; who
Tue Sep 15 05:02:55 UTC 2015
pi       pts/0        2015-09-15 02:46 (192.168.1.13)

Information:
- date executed first; this is a compound (composed of two or more parts) command.
- dont forget the semi-colon to seperate commands

$ uptime
pi@raspberrypi ~ $ uptime
 05:32:33 up 13:49,  1 user,  load average: 0.00, 0.01, 0.05

Information:
- Show/tell how long the system has been up. In this example: 5 hours, 32 minutes, 33 seconds.

$ man

Information: command should you use to access the online help for a utility. Commands = utility.

$ ls

Example:
pi@raspberrypi ~ $ ls
add.sh     Desktop        helloworld    python_games    test.py
aloha.txt  Documents      helloworld.c  python.py.save  test.pyc
array.c    helloserver.c  learnc        Scratch         world.sh


$ ls -a

Information: list files and directories include hidden file.

Example:
pi@raspberrypi ~ $ ls -a
.              .bashrc          .gvfs          python_games    .vnc
..             .cache           helloserver.c  python.py.save  world.sh
add.sh         .config          helloworld     .scratch        .Xauthority
aloha.txt      .dbus            helloworld.c   Scratch         .xsession-errors
array.c        Desktop          .idlerc        test.py
.asoundrc      Documents        learnc         test.pyc
.bash_history  .fontconfig      .local         .themes
.bash_logout   .gstreamer-0.10  .profile       .thumbnails


$ ls -F
pi@raspberrypi ~ $ ls -F
add.sh*    Desktop/       helloworld*    python_games/   test.py*
aloha.txt  Documents/     helloworld.c*  python.py.save  test.pyc
array.c    helloserver.c  learnc/        Scratch/        world.sh*

$ ls -1

Information: 
Example:
pi@raspberrypi ~ $ ls -1
add.sh
aloha.txt
array.c
Desktop
Documents
helloserver.c
helloworld
helloworld.c
learnc
python_games
python.py.save
Scratch
test.py
test.pyc
world.sh

$ cat
To view the content of a file
Example:
pi@raspberrypi ~ $ cat helloworld.c
#include <stdio.h>

int main()
{
        printf("Hello, World!");
        return 0;
}

$ cat -n 
$ cat -n helloworld.c

To view the content of a file with numbers the output lines
Example:
pi@raspberrypi ~ $ cat -n helloworld.c
     1  #include <stdio.h>
     2
     3  int main()
     4  {
     5          printf("Hello, World!");
     6          return 0;
     7  }

$

No comments:

Post a Comment