title: linux command
tags: nonetag
categories:
echo hello,world!
pwd
cd /etc/test
cd test2
ls
ls /home
ls -a show all of the files include the files which are hidden.
ls -l l means long, this command will show the files with their detile.
ls -la show all the files with their detile.
ls -R recursively list directory contents.
ls -r reverse order while sorting.
ls -t sort by modification time, newest first.
touch myfile
touch myfile
touch mydirectory
file myfile
cat file1 file2
wget linuxqq_2.0.0-b2-1089_x86_64.sh
mv linuxqq_2.0.0-b2-1089_x86_64.sh qq
less qq
q quit out of less and back to your shell
Page up, Page down, up and down Navigate.
g move to the beginning of the text file
G move to the end of the file
h help
/search search the content behind /
less qq
/qq
history show commands you have typed
ctrl-R
clear clear the screen
cp myfile /home/files
cp *.jpg /home/jpgs
cp -r directoryone/ /home/document copy the directory
cp -i my file /home/files prompt you before overwriting a same-name-file.
mv a b
mv directory1 directory2
mv a b directory1 directory2 /home
mv -i directory1 directory2
mv b a
the previous file a will be back up and renamed as ~a
mkdir one two
mkdir -p one/one two/tow
rm filea
rm -f filea
rm -i filea
rm -r directory
or
rmdir directory
find /home -name qq
find /home -type d -name mydirectory
help echo
echo --help
man ls
whatis cat
alias foobar='ls la'
unalias foobar
exit
or
logout
以下信息来源于 linux tools quick tutorial
whatis [command]
whatis -w "m*"
info [command]
man [command]
which [command]
whereis [command]
mkdir
touch
rm
mv
cp
pwd
cd - #切换到上一个工作目录
cd ~ #回到home目录
cd ../
dd
if=file #read from file instead of stdin
of-file write to file instead of stdout
by=bytes #read and write bytes bytes at a time (指定块大小)
count=blocks #copy only blocks input blocks 指定块数量
seek=blocks #把块输出到文件时指定要跳过的几块
conv=convs #指定追加数据时的操作 notrunc 是不打断文件。
dd if=mbr.bin of=hd60M.hd bs=512 count=1 seek=0 conv=notrunc