zqLSN的个人博客分享 http://blog.sciencenet.cn/u/zqLSN

博文

Unix基础-命令行的使用 Basics 1

已有 1293 次阅读 2020-3-24 09:55 |系统分类:科研笔记

https://bioinformaticsworkbook.org/list.html

Unix Basics 1

 mkdir    #make directory
 pwd    #print working directory
 cd     #change directory  
           cd ~ or cd    #home directory
    cd ..     #previous (parent directory)
 ls     #list contents
 
 touch *.txt  #create empty file *.txt
 vim *txt   #text editor  see More-- http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/
 
 cat     #catalog file contents  cat FILE
 head     #show first few lines of a file 默认10行
 tail     #show last few lines of a file  默认10行
 more     #view file (with less options)  
 less     #view file (with more options)  
 seq     #write a sequence of numbers [seq 首数 增量 尾数]
 
 rmdir    #remove empty directory
 rm     #remove file(s)
 cp     #copy files/directories
 mv     #move files/directories
 
 wc     #word count
 sort     #sort files  sort FILE1 > SORTED_FILE1  
 uniq     #display unique lines  uniq [OPTIONS] INFILE > OUTFILE    
 tr     #translate or transliterate a file,replace character   tr [OPTIONS] “STRING1” “STRING2” < INFILE
 
 ######管道和重定向
 cmd1 | cmd2  #send output of cmd1 to cmd2  cat FILENAME | sort | uniq
 cmd < file   #use file as input
 cmd > file   #write output to file
 cmd >> file  #append output to file,不直接覆盖,添加文本内容
 
 ######文本操作,正则表达
 grep     #search a pattern  grep [OPTIONS] “PATTERN” FILENAME
 sed     #stream editor  sed 'OPERATION/REGEXP/REPLACEMENT/FLAGS' FILENAME
 *      #variable used to represent many characters  ls *.txt
 ’?’     #variable used to represent any one character  ‘ls’ ?.txt
 
 ######数据下载
 wget     #URL download specified URL  wget https://saltandpepper.jpg
 scp     #secure copy  scp username@hostname/Path2Folder/FILENAME .
 rsync    #remote sync  rsync -avz -e ssh username@hostname:/Path2Folder .

推荐好用的Linux命令大全网站 https://man.linuxde.net/

教程中命令索引 https://ss64.com/bash/index.html




https://blog.sciencenet.cn/blog-3427993-1225009.html


下一篇:EndNote-OutStyle for PPT
收藏 IP: 42.239.3.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-22 10:47

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部