0% found this document useful (0 votes)
11 views

Experiment 2

Uploaded by

taehyung kim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Experiment 2

Uploaded by

taehyung kim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERIMENT-2

OBJECTIVE
Start Raspberry Pi and try various Linix commands in command terminal window:

ls, cd, touch, mv, rm, man, mkdir, rmdir, tar, gzip, cat, more, less, ps, sudo, cron, chown, chgrp,
ping etc

COMMANDS: -

1) touch: Create a new file or update its timestamp.


 Syntax: touch [OPTION]…[FILE]
 Example: Create empty files called ‘file1’ and ‘file2’
 $ touch file1 file2

2) cat: Concatenate files and print to stdout.


 Syntax: cat [OPTION]…[FILE]
 Example: Create file1 with entered content
 $ cat > file1
 Hello
 ^D

3) cp: Copy files


 Syntax: cp [OPTION]source destination
 Example: Copies the contents from file1 to file2 and contents of file1 is retained
 $ cp file1 file2

4) mv: Move files or rename files


 Syntax: mv [OPTION]source destination
 Example: Create empty files called ‘file1’ and ‘file2’
 $ mv file1 file2

5) rm: Remove files and directories


 Syntax: rm [OPTION]…[FILE]
 Example: Delete file1
 $ rm file1

6) mkdir: Make directory


 Syntax: mkdir [OPTION] directory
 Example: Create directory called dir1
 $ mkdir dir1
7) rmdir: Remove a directory
 Syntax: rmdir [OPTION] directory
 Example: Create empty files called ‘file1’ and ‘file2’
 $ rmdir dir1

8) cd: Change directory


 Syntax: cd [OPTION] directory
 Example: Change working directory to dir1
 $ cd dir1

9) pwd: Print the present working directory


 Syntax: pwd [OPTION]
 Example: Print ‘dir1’ if a current working directory is dir1
 $ pwd

10) ls or list
 Syntax: $ ls
 Example: The ls command prints out the contents of a directory

11) more
 more is one of the oldest terminal pagers in the UNIX ecosystem. Originally, more could
only scroll down, but now we can use it to scroll up one screen-full at a time, and scroll down
either one line or one screen-full:
 more filename.txt

12) chown

 chown [OPTIONS] USER [: GROUP] FILE(s)

 USER is the user name or the user ID (UID) of the new owner. GROUP is the name of the
new group or the group ID (GID). FILE(s) is the name of one or more files, directories or
links. Numeric IDs should be prefixed with the + symbol.

You might also like