首页 > 系统相关 >Linux基本命令

Linux基本命令

时间:2023-12-04 13:33:07浏览次数:46  
标签:基本 files name directories 命令 directory file Linux Usage

  1. ls: Lists files and directories.

    • Usage: ls, ls -l (long format), ls -a (including hidden files)
  2. cd: Changes the current directory.

    • Usage: cd [directory], cd .. (parent directory), cd (home directory)
  3. pwd: Displays the path of the current working directory.

    • Usage: pwd
  4. cp: Copies files and directories.

    • Usage: cp [source] [destination], cp -r [source_directory] [destination_directory] (recursive copy)
  5. mv: Moves or renames files and directories.

    • Usage: mv [source] [destination], mv [old_name] [new_name]
  6. rm: Removes files and directories.

    • Usage: rm [file], rm -r [directory] (recursive remove)
  7. mkdir: Creates new directories.

    • Usage: mkdir [directory_name]
  8. touch: Creates a new empty file or updates the timestamp of an existing file.

    • Usage: touch [file_name]
  9. cat: Concatenates and displays the content of files.

    • Usage: cat [file], cat [file1] [file2] > [new_combined_file]
  10. grep: Searches for a specific pattern in files or input.

    • Usage: grep '[pattern]' [file], cat [file] | grep '[pattern]'
  11. find: Searches for files and directories based on various criteria.

    • Usage: find [directory] -name '[pattern]', find [directory] -type f (files only)
  12. sudo: Executes commands with superuser privileges.

    • Usage: sudo [command]
  13. chmod: Changes the permissions of files or directories.

    • Usage: chmod [permissions] [file]
  14. chown: Changes the owner and group of files or directories.

    • Usage: chown [user]:[group] [file]
  15. df: Displays disk space usage.

    • Usage: df, df -h (human-readable format)
  16. du: Displays the disk usage of files and directories.

    • Usage: du, du -h (human-readable format)
  17. ps: Shows information about active processes.

    • Usage: ps, ps -aux
  18. kill: Terminates processes.

    • Usage: kill [process_id], kill -9 [process_id] (force kill)
  19. nano, vi, emacs: Text editors for editing files.

    • Usage: nano [file], vi [file], emacs [file]
  20. man: Displays the manual page for other commands.

    • Usage: man [command]

标签:基本,files,name,directories,命令,directory,file,Linux,Usage
From: https://www.cnblogs.com/maluyelang/p/17874719.html

相关文章

  • 嵌入式linux:GPIO应用学习
    一、准备工作1、开发板串口连上电脑。2、挂载nfs文件:将ubuntu的/nfsroot文件夹映射到将开发板的/mnt文件夹(此处对应笔者的虚拟机)mount-tnfs-onolock,vers=3192.168.3.61:/nfsroot/mnt 二、了解GPIO应用层1、开发板的GPIO通过sysfs方式进行操作,进入/sys/class/gp......
  • [转] adb 介绍及命令说明
    ADB工具介绍ADB的全称为AndroidDebugBridge,就是起到调试桥的作用,是AndroidSDK里面一个多用途调试工具,通过它可以和Android设备或模拟器通信,借助adb工具,我们可以管理设备或手机模拟器的状态。还可以进行很多手机操作,如安装软件、系统升级、运行shell命令等。其实简而言说......
  • Servlet Session基本概念和使用方法,获取Session对象: 在Servlet中,可以使用HttpServletR
    ServletSession基本概念和使用方法,获取Session对象:在Servlet中,可以使用HttpServletRequest对象的getSession()方法来获取当前请求的Session对象目录Session介绍Session使用步骤Session示例LoginServletsuccess.jspfailure.jspSession介绍Session是Web开发中的一种机......
  • 嵌入式Linux: 使用Cmake交叉编译tslib库
    在编译第三方库时,往往要指定头文件和库的链接地址,每次输入又比较麻烦,所以产生了是否能用Cmake交差编译嵌入式Linux的想法,经过实验确实可行,以下记录操作过程。一、新建项目项目目录如下:arm_build:安放交叉编译生成的文件 build:安放gcc编译生成的文件 arm_linux_setup.cmake......
  • Linux上使用CMake简单例子
    记录一下自己简单在linux-Ubuntu上用cmake的例子首先安装cmakesudoaptinstallcmake然后创建一个文件夹,里面放点例子代码main.cpp//main.cpp#include<iostream>#include"demo.h"usingnamespacestd;intmain(){Demod;d.show();return0;}demo.h//de......
  • Linux LVM扩容详解
    1、将物理磁盘设备初始化为物理卷pvcreate/dev/sdb/dev/sdc查看物理卷命令:pvs删除物理卷:rmpv/dev/sdb2、创建卷组,并将PV加入卷组vgcreatename/dev/sdb/dev/sdc查看卷组:vgs删除卷组rmvgname3、基于卷组创建逻辑卷lvcreate-nname1-L2Gname......
  • linux上的rsync命令详解【转】
    1.rsync简介rsync就是远程同步的意思remotesync.rsync被用在UNIX/Linux执行备份操作操作.rsync工具包被用来从一个位置到另一个位置高效地同步文件和文件夹.rsync可以实现在同一台机器的不同文件直接备份,也可以跨服务器备份.2.rsync的重要特性速度快:初次同步时,......
  • 在Linux系统中通过 vim 进行文本替换(转)
    在Linux系统中通过vim进行文本替换本文转自:https://www.cnblogs.com/wind-wang/p/5768000.html在vim中,可以通过:setnu或:setnumber的命令来显示文本的行号在VIM中进行文本替换:1.替换当前行中的内容::s/from/to/(s即substitude):s/from/to/:将......
  • Linux开启SSH连接
    1、查看是否安装 openssh-server:yumlistinstalled|grepopenssh-server已安装成功,如下图2、如果没有任何输出显示表示没有安装openssh-server,通过输入 yuminstallopenssh-server安装3、进入/etc/ssh/目录下找到配置文件sshd_config,用Vim编辑器打开。命令vimsshd_......
  • 算数基本定理
    算数基本定理定理对于整数\(a>1\),必有\(a=p_1^{a_1}p_2^{a_2}\dotsp_s^{a_s}\),其中\(p_j(1\leqj\leqs)\)是两两不相等的质数,\(a_j(1\leqj\leqs)\)表示对应质数的幂次。在不计次序的意义下,该分解式是唯一的。运用于质因数分解:intDecomposition(intx,inta[]){......