Some useful linux commands

本文汇总了日常工作中频繁使用的Linux命令,包括环境变量设置、硬件配置查看、文件压缩与解压、用户切换、磁盘空间查看等实用技巧,旨在帮助读者快速掌握Linux的基本操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

These are mostly used linux commands I applied daily, I paste it here once it is useful for you.

1.        

Permanently set the Environment Variables

 

classpath=” ”

export classpath

2.        

To see the hardware configuration

 

cat /proc/cpuinfo

3.        

Tar commands

 

tar –xvvzf myfile.tar.gz  // to leave the .tar.gz unchanged

 

tar –pczf myfile.tar.gz  /path/...  // to compress

 

gzip –c test.text>test.gz

 

tar –xvvf myfile.tar  // to extract

4.        

To change the login user name

 

su username

5.        

To see the size of file or directory

 

du –skh filename

6.

To show the disk space

 

df -h

6.        

Copy files from one computer to another

 

scp myfile username@xxx.xxx.xxx:c:/   

scp myfile username@xxx.xxx.xxx:/opt/   // where xxx is the hostname of target computer

7.        

To see the CUP and Memory usage

 

top

8.        

Vi commands

 

vi myfile.config  // to view the file

 

:q  // to exit

 

:q!  // to exit witout the change

 

:wq  // to exit with change

 

:cw  // change word

 

:cc  // change a line

9.        

Make a backup file

 

cp –b myfile1 myfile2

10.    

Create direcory

 

mkdir mydirectory

11.    

Set file permission

 

chmod 777 mybatch.sh

12.    

To check the OS

 

cat /etc/redhat-release

13.    

Force to delete the directory

 

rm –rf direcory

14.    

Search for a file name

 

find . –name myfile

15.    

Start Xwin X server

 

Start Cygwin Bash Shell

cd /usr/x11R6/bin

./startxwin.bat

16.

View IP Address

 

hostname -i

17.

View and kill Processes

 

ps: to view processes

kill -9 process id

18.

Copy the entire directory

 

cp -R dir/ newdir/

19.

View port

 

Netstat –an | grep 9081

Netstat –an > /tmp/port.out

 

### ADAMS Software Installation and Usage on Linux The following information provides a detailed guide to installing, configuring, and using ADAMS (Advanced Data Mining And Machine Learning System) software on a Linux system. While specific instructions may vary depending on the version of ADAMS being used or your distribution's package management tools, this response will cover general principles. #### Prerequisites Before proceeding with the installation process, ensure that Java Development Kit (JDK) is installed because ADAMS relies heavily on Java-based technologies[^1]. To verify whether JDK has been correctly set up: ```bash java -version javac -version ``` If these commands do not produce expected results indicating proper versions are present, consider downloading an appropriate release from Oracle’s official website or adopt OpenJDK via standard repositories such as those managed by Red Hat Package Manager (RPM). #### Downloading ADAMS To obtain ADAMS binaries suitable for deployment under Unix-like environments including various flavors within GNU/Linux ecosystem, visit its project page hosted at SourceForge.net where stable releases along with source archives can be found[^3]: Download link example: `wget https://sourceforge.net/projects/waikato-adams/files/latest/download` Extract downloaded archive after ensuring it matches checksum provided online before extraction step begins. ```bash tar xf adams-x.y.z-bin.tar.gz cd adams-x.y.z/ ``` Here replace `adams-x.y.z-bin.tar.gz` appropriately based upon actual filename retrieved earlier during download phase above mentioned command sequence assumes tarball format; adjust accordingly should other compression schemes apply instead like zip files etc.. #### Running ADAMS Application Once extracted successfully into desired directory structure inside filesystem hierarchy then navigate towards bin subdirectory containing executable scripts responsible launching graphical user interface(GUI): For systems utilizing Bourne Again Shell(BASH), execute below line which initiates main application window allowing interaction through point-and-click operations thereafter : ```bash ./run.sh gui ``` Alternatively there exists also possibility running headless mode useful performing batch processing tasks without requiring visual feedback whatsoever simply invoking script followed argument specifying operation type required e.g., flow execution : ```bash ./run.sh flow myflow.xml ``` In both cases make sure environmental variables PATH includes location pointing toward java binary otherwise specify full path explicitly when calling aforementioned startup routines . #### Configuration Adjustments Post Setup Phase Complete After initial setup completes itself few additional tweaks might become necessary optimize performance according particular use case scenarios faced daily basis . Some common areas involve tweaking memory allocation parameters passed JVM instance started every time program runs again refer documentation accompanying sources regarding exact syntax needed accomplish same goal effectively across different platforms supported officially too ! Example modifying heap size limits defined within wrapper.conf file located conf folder relative root install dir specified previously : ```properties wrapper.java.additional=-Xms512m wrapper.java.additional=-Xmx4g ``` Remember restart service post making changes take effect immediately next invocation cycle performed subsequently afterwards .. --- ### §§ 1. What alternative methods exist besides RPM packages discussed here initially concerning managing dependencies while setting up complex applications similar natured compared against current topic covered ? 2. How does one go about troubleshooting issues encountered first attempts executing newly-installed instances especially relating compatibility concerns between underlying OS kernel features versus expectations laid out upstream developers side ? 3. Can customization extent extend beyond mere configuration edits touching core functionalities themselves perhaps extending feature sets available default distributions shipped originally ? If yes what steps involved achieving said outcome safely preserving stability long term perspective maintained throughout entire lifecycle product lifespan considered overall ?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值