|
CSC128: Introduction to Linux
Basic Commands
Passwords
A good password is easy to remember,
but difficult to guess. Don't write your password down; try to pick one that
you can remember using mnemonics. For example, if you were born on April
1, 1965, apR#01nsf
might be a good password .
Good passwords include letters (both
cases), numbers, and symbols.
Good passwords are at least six characters long.
Good passwords do NOT use words that can be found in any dictionary
or proper names at all.
Examples of bad passwords:
password
Billy1
39578
j0hns0n
s2
Examples of good passwords:
25bgsF$
bB76##-
tNfS8!
jJ100@nN
Use the
passwd command to change your password. (This may be different
on other systems.)
NOTE: you should definitely change
your password from the default password given to you.
Shells
tty, terminal emulators (pp. 25-26)
- Ctrl-H/Ctrl-?: Backspace
- Ctrl-W: Erase a word from the command line
- Ctrl-U: Erase entire line
- Ctrl-C: Abort execution
Shell prompt
- $ or
% or > which is our prompt
- #
usually means root (which is the login name of the system manager)
Exiting the shell
Some shells:
bash, sh,
tcsh, ksh,
zsh, etc.
We will only be studying and using the bash shell.
Files
Everything in Linux is a file.
Text (e.g. source code), programs,
directories, access to devices (peripherals, etc.), streams of data, etc.
are all files.
Just type the name of a program
to execute it. If it isn't in the current search path, then you must
type the pathname with the filename.
Linux searches many directories
to find the program you wish to run-the directories it searches is called
the search path.
A pathname is the way we
tell Linux about the location of a file we wish to use.
For example:
/home/students/a/abear/test_file. Here,
/home/students/a/abear/ is the pathname, and
test_file is the filename.
We will discuss this in greater
depth later, when we talk more about filesystems.
Basic Commands
- ls
provides a list of the files in the current directory.
- ls -l
provides a long list, that includes information about each file.
- ls -la
provides a long list, about ALL files even hidden ones (files that begin
with a . in their name).
- cp
copies files from one name to another, or from one location to another.
- mkdir
makes a new directory.
- rmdir
removes a directory. The directory must be empty to be removed unless you
'force' it (see the man page for info).
- mv
moves or renames files.
- rm
permanently removes files.
- cat
displays the contents of a text file.
more and
less make it easy to look at one page at a time, search through
the text, etc.
- head
tail
display only the beginning or end of text.
- man
get detailed information about a command.
- info
get detailed information about a command.
|