some Linux shell commands

1. date: show current date and time.

2. cal: calendar.

3. df: to see the current amount of free space on your disk drives.

4. free: show the amount of the free memory(if using this command at Cygwin, crocps package should have been installed first).

5. exit: to end a terminal session.

6. pwd: print name of current working directory. The working directory is the current directory that we are standing in of the file system.

7. cd: change directory. Symbol "/" stands for the root directory of a file system. And the English name of the symbol is leading slash.

  The directory in which most of your system‘s programs are installed is /usr/bin.

  The symbol "."(dot) refers to the current working directory and the ".."(two dot) refers to the parent directory of current working directory.

  The symbol "./" which stands for the current directory can be omitted. "./bin" is equal to "bin"

  The symbol "~" refers to your home directory.

  "$ cd" changes to your home directory.

  "$ cd -" changes to the previous directory.

  "$ cd ~user_name" changes to the user_name‘s home directory.

  BTW: Linux supports space character in a file name. But it‘s not recommended to do that.(the discussion about that)

8. ls: list directory contents.

  -l option list more info of files.

  There are some more options that can be found on the help page.

  If the prefix of a file is a period, it means that the file is hidden. So it well not be listed. Except appending -a(--all) option to ls.

  -d option list the info of the directory itself instead of its contents.

  --color colorize the file names. You can redefine ls to ls --color in /home/your_name/.bashrc to make the option always setted.(a post about this)

9.

时间: 2024-10-12 15:25:01

some Linux shell commands的相关文章

[Python] 利用commands模块执行Linux shell命令

用Python写运维脚本时,经常需要执行linux shell的命令,Python中的commands模块专门用于调用Linux shell命令,并返回状态和结果,下面是commands模块的3个主要函数: 1. commands.getoutput('shell command') 执行shell命令,返回结果(string类型) >>> commands.getoutput('pwd') '/home/oracle' 2. commands.getstatus('file') 该函数

run commands in linux shell using batch file

adb shell as root after device rooted once device rooted, we must perform "su" before we get root permission in adb shell,this is not convenient in some situations,so there have a method to get permission without perform "su". adb shel

Linux Shell脚本攻略(1.10)

1.10 获取.设置日期和延时 很多应用程序需要以不同的格式打印日期.设置日期和时间.根据日期和时间执行某项操作.延时通常用于在程序执行过程中提供一段等待时间(比如1秒).同样的,我们也能够一多种格式打印日期,或者在命令行中设置日期.在类Unix系统中,日期被存储为一个整数,其大小为自世界标准时间起所流逝的秒数.这种计时方式称为纪元时或Unix时间. 1.10.1 获取.设置时间 以下的程序给出了多种用法: #!/bin/bash start=$(date +%s) #获取纪元时间 date #

(linux shell)第一章--小试牛刀(下)

文章来源: (linux shell)第一章--小试牛刀(下) 1.6 数组和关联数组 1.6.1 预备知识 Bash同一时候支持普通数组和关联数组.普通数组仅仅能使用整数作为数组索引,而关联数组能够使用字符串作为数组索引.关联数组在非常多操作中相当实用. 1.6.2 实战演练 定义数组的方法有非常多,能够在单行中使用一列值来定义一个数组: array_var=(1,2,3,4,5,6)   #这些值将会存储在以0为起始索引的连续位置上 另外.还能够将数组定义成一组索引-值: array_var

LINUX SHELL脚本攻略笔记[速查]

Linux Shell脚本攻略笔记[速查] 资源 shell script run shell script echo printf 环境变量和变量 pgrep shell数学运算 命令状态 文件描述符和重定向 cat 数组和关联数组 alias date 调试脚本 函数和参数 管道 读取命令输出 read 字段分隔符和迭代器 循环 比较和测试 find xargs tr md5sum sha1sum 对目录进行校验 sort uniq tempfile split bash变量匹配切分 exp

在windows上使用jenkins远程执行linux shell命令

最近公司把jenkins搭建在windows上面,但是发布是要发布到linux服务器上,所以在自动部署上面会有执行shell命令的问题,遂找了一下: 发现jenkins有个shell脚本的插件: shell plugin This plugin executes shell commands remotely using SSH protocol. 安装这个插件,然后到构建任务里面选择构建,到构建后操作里面,会发现有一项是: Excute shell script on remote host

思维导图学 Linux Shell攻略之小试牛刀篇

曾听一位大神讲过,带着目的去学,知识往往能记得牢,记得稳.借助思维导图这个工具,对一些我感兴趣的知识点进行分类管理.以后方便自己复习. 我会以思维导图+代码段的方式,回滚学习linux shell编程. 转义/色彩 与用户交互的接口 #打印一个普通的字符串 [[email protected] ~]# echo "it's isa dog" it's is a dog   #打印一个带有单引号和换行符的字符串,单引号可正常输出,但换行符没有效果 #没有达到想要的效果 [[email p

Linux Shell 运维脚本功底积累

1.删除Linux远程用户连接会话 [[email protected] logs]# w 10:45:28 up 15 days, 16:23, 4 users, load average: 0.00, 0.00, 0.00 USER TTY FROM [email protected] IDLE JCPU PCPU WHAT root tty1 - Sun21 4days 0.00s 0.00s -bash root pts/0 192.168.1.2 09:11 0.00s 0.07s 0

Linux Shell 文本处理工具集锦 zz

内容目录: find 文件查找 grep 文本搜索 xargs 命令行参数转换 sort 排序 uniq 消除重复行 用tr进行转换 cut 按列切分文本 paste 按列拼接文本 wc 统计行和字符的工具 sed 文本替换利器 awk 数据流处理工具 迭代文件中的行.单词和字符 本文将介绍Linux下使用Shell处理文本时最常用的工具: find.grep.xargs.sort.uniq.tr.cut.paste.wc.sed.awk: 提供的例子和参数都是最常用和最为实用的: 我对shel