Difference between revisions of "Introduction to Linux"

From Void-Byte
Jump to navigation Jump to search
Line 1: Line 1:
 +
== Data Streams ==
 +
 +
=== STDIO ===
 +
Standard Input/Output (STDIO) contains 3 main streams of data associates with a file handle which are STDIN (file handle:0), STDOUT (file handle:1), and STDERR (file handle:2). STDIO is used to stream output data from one program to the input of another program.
 +
 +
=== STDIN ===
 +
Standard Input (STDIN) is input from the keyboard.
 +
 +
=== STDOUT ===
 +
Standard Output (STDOUT) is output sent to the terminal.
 +
 +
=== STDERR ===
 +
Standard Error (STDERR) is errors sent to the terminal.
 +
 
==Basic Commands==
 
==Basic Commands==
 
These are the most basic commands that you should know as a Linux System Administrator.
 
These are the most basic commands that you should know as a Linux System Administrator.
Line 7: Line 21:
  
 
===Commands===
 
===Commands===
{| class="wikitable"
+
echo
|+
+
 
!Name
+
ls
!Description
+
 
!Syntax
+
pwd
!Example
+
 
|-
+
cd
|'''cat'''
+
 
|Concatenate files, and print to stdout.
+
touch
|cat [-options] <path/file>
+
 
|cat readme.txt
+
cp
|-
+
 
|'''cp'''
+
mkdir
|Copy files or directories.
+
 
|cp [-options] <source> <destination>
+
cat
|cp -R olddirectory newdirectory
+
 
|-
+
su
|'''echo'''
+
 
|Print text to stdout.
+
sudo
|echo [-options] <string>
+
 
|echo -e This my first line \n This is my second line
+
sudoedit
|-
+
 
|'''ls'''
+
visudo
|List directory contents.
+
 
|ls [-options] <path/file>
+
whoami
|ls -alh /var/log
+
 
|-
+
who
|'''mkdir'''
+
 
|Make a directory.
+
w
|mkdir [-options] <path/directory>
+
 
|mkdir -p /my/directory/path
+
last
|-
+
 
|'''mv'''
+
id
|Move or rename a file.
+
 
|mv [-options] <source> <destination>
+
=== Power Management ===
|mv /from/here/file1.txt /to/here/file1.txt
+
shutdown
|-
+
 
|'''pwd'''
+
=== Command Information ===
|Print the current working directory.
+
man
|pwd [-options]
+
 
|pwd -P
+
apropos
|-
+
 
|'''touch'''
+
whatis
|Change file timestamp or create blank file.
+
 
|touch [-options] <path/file>
+
info
|touch -c update.txt
+
 
|}
+
=== Password Management ===
<br />
+
passwd
 +
 
 +
chage
 +
 
 +
=== User Management ===
 +
useradd
 +
 
 +
usermod
 +
 
 +
userdel
 +
 
 +
=== Group Management ===
 +
groupadd
 +
 
 +
groupmod
 +
 
 +
groupdel

Revision as of 13:57, 14 June 2020

Data Streams

STDIO

Standard Input/Output (STDIO) contains 3 main streams of data associates with a file handle which are STDIN (file handle:0), STDOUT (file handle:1), and STDERR (file handle:2). STDIO is used to stream output data from one program to the input of another program.

STDIN

Standard Input (STDIN) is input from the keyboard.

STDOUT

Standard Output (STDOUT) is output sent to the terminal.

STDERR

Standard Error (STDERR) is errors sent to the terminal.

Basic Commands

These are the most basic commands that you should know as a Linux System Administrator.

Command Syntax

Commands that utilize the Bash shell follow this common syntax.

command [-options] [arguments]

Commands

echo

ls

pwd

cd

touch

cp

mkdir

cat

su

sudo

sudoedit

visudo

whoami

who

w

last

id

Power Management

shutdown

Command Information

man

apropos

whatis

info

Password Management

passwd

chage

User Management

useradd

usermod

userdel

Group Management

groupadd

groupmod

groupdel