The linux command line--part one(一) Learing Shell
2017-01-16 10:31
423 查看
Part One Learing Shell
1.what is shell?
GNU/Linux are different things. Linux is the kernel.
[username@machinename directory] $ (a dollar sign) # means superuser privileges
command history ↑ remember the last 1000 by default
the shell is all about keyboard.
some command: df, cal, free,date.
2.Navigation
pwd - Print name of current working directory
cd - Change directory . the working directory by default .. the working directory's parent directory
some shoutcuts : cd
cd - changes the working directory to the precious working directory
cd ~username
ls - List directory contents
ls -a list all the files including hidden files.
files name are case sensitive
linux has no concept of "file extension", but many application programs do.
do not use embedded spaces ,you can use dash underscore instead.
3.Exploring the system
ls
ls ~/source
ls -l
ls -lt t order by files' modification time
ls -lt --reverse
file - Determine file type
file filename ---print a brief description of the file's content
everything is a file
less - View file contents
text
some of the programs that the system uses(called scripts)
less filename ---view the file
less is more.
In linux,there is no secrets.
Symbolic Links
lrwxrwxrwx 1 root root 11 2007-08-11 07:34 libc.so.6 -> libc-2.6.so
l
hard links
4.Manipulating Files And Directories
cp - Copy files and directories
cp item1 item2 copy the single file or directory item1 to file or directory item2
cp item... directory copy multiple items(either files or directories) into a directory
mv - Move/rename files and directories(剪切)
mv item1 item2 to move or rename file or directory "item1" to "item2"
mv item... directory to move one or more items from one directory to another
mkdir - create directories
mk directoryname
mk dir1 dir2 dir3 create three directories name dir1,dir2,dir3
rm - remove directories
be careful with rm
ln - create hard and symbolic links
ln file link to create a hand link
ln -s item link to create a symbolic link where "item" is either a file or a directory
hard link and symbolic link
Wildcard is powerful!
5.Working With Commands
type - Indicate how a command name is interpreted
type type
type ls
type cp
which - Display which executable program will be executed
which ls
which cd
help - Get help for shell builtins
help cd
mkdir --help
man - Display a command's manual page
man ls
man 5 passwd
apropos - Display a list of appropriate commands
apropos l
info - Display a command's info entry
whatis - Display a very brief description of a command
whatis ls
alias - Create an alias for a command
line trick command1; command2;command3
alias foo='cd /usr; ls; cd - '
type foo
unalias foo
type foo
alias ls
alias --list all the alias
1.what is shell?
GNU/Linux are different things. Linux is the kernel.
[username@machinename directory] $ (a dollar sign) # means superuser privileges
command history ↑ remember the last 1000 by default
the shell is all about keyboard.
some command: df, cal, free,date.
2.Navigation
pwd - Print name of current working directory
cd - Change directory . the working directory by default .. the working directory's parent directory
some shoutcuts : cd
cd - changes the working directory to the precious working directory
cd ~username
ls - List directory contents
ls -a list all the files including hidden files.
files name are case sensitive
linux has no concept of "file extension", but many application programs do.
do not use embedded spaces ,you can use dash underscore instead.
3.Exploring the system
ls
ls ~/source
ls -l
ls -lt t order by files' modification time
ls -lt --reverse
file - Determine file type
file filename ---print a brief description of the file's content
everything is a file
less - View file contents
text
some of the programs that the system uses(called scripts)
less filename ---view the file
less is more.
In linux,there is no secrets.
Symbolic Links
lrwxrwxrwx 1 root root 11 2007-08-11 07:34 libc.so.6 -> libc-2.6.so
l
hard links
4.Manipulating Files And Directories
cp - Copy files and directories
cp item1 item2 copy the single file or directory item1 to file or directory item2
cp item... directory copy multiple items(either files or directories) into a directory
mv - Move/rename files and directories(剪切)
mv item1 item2 to move or rename file or directory "item1" to "item2"
mv item... directory to move one or more items from one directory to another
mkdir - create directories
mk directoryname
mk dir1 dir2 dir3 create three directories name dir1,dir2,dir3
rm - remove directories
be careful with rm
ln - create hard and symbolic links
ln file link to create a hand link
ln -s item link to create a symbolic link where "item" is either a file or a directory
hard link and symbolic link
Wildcard is powerful!
5.Working With Commands
type - Indicate how a command name is interpreted
type type
type ls
type cp
which - Display which executable program will be executed
which ls
which cd
help - Get help for shell builtins
help cd
mkdir --help
man - Display a command's manual page
man ls
man 5 passwd
apropos - Display a list of appropriate commands
apropos l
info - Display a command's info entry
whatis - Display a very brief description of a command
whatis ls
alias - Create an alias for a command
line trick command1; command2;command3
alias foo='cd /usr; ls; cd - '
type foo
unalias foo
type foo
alias ls
alias --list all the alias
相关文章推荐
- The linux command line--part one(二) Learing Shell
- the linux Command Line 学习笔记--mysql命令行导入sql文件到指定数据库的方法
- 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令
- The Linux Command Line 21-30章总结
- the diary of sleep jobs & fg command line in linux
- The Linux Programming Interface Appendix B Parsing Command-Line options 解析命令行中的选项
- 《The Linux Command Line》 读书笔记02 关于命令的命令
- The Linux Command Line 读书笔记(二)之文件系统The file system操作的命令
- The Linux Command Line 31-37章总结
- Beginning the Linux Command Line--第2章 完成基本命令行任务
- The linux command line--part 4 Writing Shell Scripts
- The difference between && and ; in the Linux command line
- The Linux Command Line 1-10章总结
- the linux command line学习笔记之三
- The Linux Command Line 11-20章总结
- 《The Linux Command Line》 读书笔记03 ls命令与长格式输出解释 文件权限
- the linux command line学习笔记之五
- How to access Dropbox from the command line in Linux
- The linux command line--part 3 Common Tasks And Essential Tools
- The linux command line--part Two Configuration And The Environment