
Part 1 link:- https://community.sap.com/t5/technology-blogs-by-members/part-1-sap-basis-os-support-on-suse-linux-f...
Basic commands
Linux administrator can login with tools like putty or kitty or other applications available in market or allowed by customer, with either root or sidadm. Whereas both the IDs have different rights W.R.T OS and sap application.
CLEAR:- The clear command will clear the terminal screen. This command can be useful if you worked for quite a while on one and the same terminal. You might want to clean it because your screen might seem “messy”. Just run clear – this lets you “wipe out” all words in the terminal.
SU and SUDO:- The su command can help you to switch to superuser. The superuser is the system user who has all permissions to be able to perform administrative tasks. Some commands require superuser privileges. As an example, only the superuser can shut down the computer. When you use the command sudo as prefix, you can promote your privileges to superuser temporarily. As an example, you can type sudo poweroff to run the command to shut down the computer.
POWEROFF and REBOOT:- The command poweroff shuts down the running system, while the command reboot cares for a reset of your system. Both commands require superuser privileges.
ZYPPER Commands
Zypper and YaST are the Package Manager for SUSE Linux, which works on top of RPM
YaST which stands for Yet another Setup Tool is a tool that works on OpenSUSE and SUSE Enterprise edition to administer, setup and configure SUSE Linux.
Zypper is the command line interface of ZYpp package manager for installing, removing and updating SUSE. ZYpp is the package management engine that powers both Zypper and YaST
Run zypper without any option, will give you a list of all global options and commands.
To open zypper shell session run the below command.
To get help on a specific command say ‘in’ (install), run the below commands
Search for a package (say gnome-desktop) before installing.
Use zypper repos or zypper lr commands to list all the defined repositories.
Use commands zypper refresh or zypper ref to refresh zypper repositories.
To refresh a specific repository say ‘repo-non-oss‘, type:
We use ‘zypper modifyrepo‘ or ‘zypper mr‘ commands to disable, enable zypper repositories.
Before disabling repository, you must know that in Zypper, every repository has its own unique number, that is used to disable or enable a repository.
Let’s say you want to disable/enable any repository, to do the same first you need to its number by typing following command.
For example we need to disable/enable “repo-oss” so its number is “6”.
To disable
To enable
Install a Package with Zypper
With Zypper, we can install packages based upon capability name. For example, to install a package (say Mozilla Firefox) using capability name. use “zypper in <full package name>” or “zipper install <full package name>”
File Permission in Linux
Every file and directory on your Unix/Linux system is assigned 3 types of owner, given below.
Permissions
Every file and directory in your Linux system has following 3 permissions defined for all the 3 owners discussed above
E.g : chmod 777 fil1 (adding read+write_execute permission)
chmod u-w file1 (removing write permission from user )
e.g : chown root : root file1.txt
Add stickbit to file or directory
# chmod +t <directory name>/
Remove stickbit to file or directory
# chmod -t <directory name>/
grep B file1
grep –r sid hosts ( to search recursively for pattern in directory )
Combination:-
How to schedule tasks, commands, or scripts to execute at specific times or intervals.Then crontab is the solution at Linux level. In SUSE linux crontab, cron.hourly, cron.daily,or cron.monthly allow scripts or commands to be run at specific times or intervals.
Cron jobs can be scheduled in many different methods with the most common being using /etc/crontab to schedule the script or command. This file is separated into seven columns with the format and description as follows:
NOTE:- Crontab is very vast and we can perform and schedule many jobs and alerting at Linux level for the same.
OS Monitoring Commands
subdirectories in current directory)
/sys/class :- Contains subdirectories grouped together as a functional types of devices (like graphics, net, printer, etc.)
/sys/device :- Contains the global device hierarchy.
sar 5 10 :- System Idle % statistics.
Here 5 is seconds
10 is instances/entries in every 5 secs
Both can be increased and decreased as per requirement
vmstat 5 10 :- Display virtual memory statistics.
Here 5 is seconds
10 is instances/entries in every 5 secs
Both can be increased and decreased as per requirement.
iostat:- Display input/output statistics.
Uname –a :- System Name and Kernel Information
finger user:- Display the information of any currently logged in users from the terminal. It is a command-line utility that can provide users login time, tty (name), idle time, home directory, shell name, etc.. Finger command with “-l” option displays all of the information described for the “-s” option as well as the user's home directory, home phone number, login shell, mail status, etc.
Whereis <app>:- Show possible locations of any app. Locate the binary, source and manual pagefiles of a command.
Network Status tools
Ip basic network diagnostics
Nethogs network usage of processes
Ss shows network status
Ethtool ethernet cards details
We can run on system to check as they are with vast details of network. Mainly used by linux network administrators only.
Env :- Shows the existing OS environmental variables. In Suse normally all the environment variables are set by default as per SAP system if we have selected SUSE for SAP media during installation.
If we want to Change or Set Environment Variable
You can use the following command to change the environment variable for the current session as per your shell. Check for .bashrc, .cshrc, .bash_profile. .profile files on server for user ID only (not available for root user as root uses default environment variables).
Search specific variable:-
For Korn shell (KSH)
The syntax is as follows:
Example To set JAVA_PATH, enter:
For Bourne shell (sh and bash)
The syntax is as follows:
Example To set PATH, enter:
For C shell (csh or tcsh)
The syntax is as follows:
Example Set EDITOR to vim, enter:
LETS CONNECT PART 3 OF THIS KNOWLEDGE SHARING TO EXPLORE MORE COMMANDS……
Any suggestions and corrections are most welcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |