Skip to content

Files and Directories

Files and Directories in Basic Commands.

4 min read Updated SS

Files and Directories#

Lists the files and directories in the current directory.

ls

Expected Output:

anaconda-ks.cfg                 ForensicAgent_Unix_1.0.0.30          main.sh
Supervisor.json
appsone_24_02.sql               ForensicAgent_Unix_1.0.0.30.zip      migration-
db_90230328.zip                   SUpervisor.json                       TICKET-000
appsone_client.tar.gz           generalConf.py                        TICKET-000.tar.gz
temp
appsoneoriginal3rdnov.sql       sample                                node-redis-
temp.txt
appsone.sql                     heal-controlcenter_1.4.2.tar          test
yaml-creator
backup_03103024.tar.gz          heal-data-receiver_1.4.0-SNAPSHOT.tar
sample_percona_db.zip  test.json
conf_properties_tmpl            heal-event-detector_1.4.1.tar         pcs-dep.tar
test_support.sql
Example                             HealHealth-Report                     percona-server-
client-8.0.33-23.2.el7.x86_66.rpm  tmp
cs_server_certs                 HealHealth-Report-1.tar.gz            redis-client
tmp.txt
DataMigrationPackage            heal-ui-service_1.2.4-SNAPSHOT.tar    redis-
client.tar.xz                    transaction_dump
DataMigrationPackage.tar.gz     hhh.json                              redis.conf
transaction_dump.sql
db_action1.json                 java_test                             redis.crt
transaction_dump.sql.zip
db_action2.json                 jim-agent.tar.gz
registry_2.8.tar                  Example.issues.tar.zip
DBmigrate                      keycloak_certs                        s1.json
sample_tar_files
delete_txn_data.sql             key.crt                               sql
sample_transaction_tables
depend                          sample_percona_dump.tar.gz          sqls_app
sample_transaction_tables.tar.gz
dump_a1_installation_attributes.sql  Logs_Test_script                 su.json
utp

Access the Directory#

To navigate to the respective directory.

cd /<directory>/<directory>

For Example:

cd /opt/appnomic/Appsone_Service

Expected Output:

[root@localhost /]# cd /opt/appnomic/Appsone_Service
[root@localhost Appsone_Service]#

Current Directory#

The below command displays the current directory.

pwd

Expected Output:

[root@localhost Appsone_Service]# pwd
/opt/appnomic/Appsone_Service

Previous Directory/File#

Navigate to previous directory or file, execute the below command:

cd ..

Expected Output:

[root@localhost Appsone_Service]# cd ..
[root@localhost appnomic]# cd ..
[root@localhost opt]# cd ..
[root@localhost /]#

To access and edit the file or folder#

vi <File name/log name>

For Example:

vi /etc/hosts

Expected Output:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6#
198.51.100.4 support.heal
192.0.2.2 server-01 server-01.example
192.0.2.2 opensearch-node1.example action-detector.example data-emitter.example
data-receiver.example ui-service.example control-center.example jaeger-node1.example
grafana.example incident-management-broker.example a1eventhandler.example mle.example
keycloak.example signal-detector.example supervisorcontroller.example eventdetector.
appnomic redis-service.example redis-node1.example rabbitmq-node1.example
haproxy-node1.example advanced-analytics-ds.example heal-computed-service.example
trinodb.example heal-scheduler-service.example heal-job-executor.example reporting-
dataservice.
appnomic

Search command#

Execute the below command inside a file, to find the specific parameter in the file.

/ <name>

For Example:

/ redis

Set the line numbers in the file#

Click Esc key and then execute the below command:

:set nu

Expected Output:

1 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6#
2 198.51.100.4 support.heal
3 192.0.2.2 server-01 server-01.example
4 192.0.2.2 opensearch-node1.example action-detector.example data-emitter.example
data-receiver.example ui-service.example control-center.example jaeger-node1.example
grafana.example incident-management-broker.example a1eventhandler.example mle.example
keycloak.example signal-detector.example supervisorcontroller.example eventdetector.
appnomic redis-service.example redis-node1.example rabbitmq-node1.example
haproxy-node1.example advanced-analytics-ds.example heal-computed-service.example
trinodb.example heal-scheduler-service.example heal-job-executor.example reporting-
dataservice.
appnomic

Switch to different server#

To access another server from current server window, execute the below command:

ssh <Server IP>

For Example:

ssh 192.0.2.2

Expected Output:

[root@localhost1 ~]#
Activate the web console with: systemctl enable --now cockpit.socket

Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Mon Sep o4 11:55:11 2023 from 192.0.2.2

Linux box version#

To check the current Linux box version:

cat /etc/os-release

Expected Output:

NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"

To access the file for modifying certificates for all services#

a. Navigate to the below path:

cd <Installation_path>/Appsone_Service/utilities/Certificate

b. Execute the below command to access the README file:

cat README

Interrupt the running command#

Stops (interrupts) the command that is currently running in the terminal and returns you to the shell prompt. It does not change directories.

Ctrl+C

Create directory#

mkdir <directory name>

For Example:

mkdir troubleshooting guide

Expected output: Once the above command is executed, there wont be any visible output. Hence check the same by executing the below command:

ls -lrt

Output:

total 906640
drwxr-xr-x.   2 root          6 Jun 21  2021 srv
lrwxrwxrwx.   1 root          8 Jun 21  2021 sbin -> usr/sbin
drwxr-xr-x.   2 root          6 Jun 21  2021 mnt
drwxr-xr-x.   2 root          6 Jun 21  2021 media
lrwxrwxrwx.   1 root          9 Jun 21  2021 lib64 -> usr/lib64
lrwxrwxrwx.   1 root          7 Jun 21  2021 lib -> usr/lib
lrwxrwxrwx.   1 root          7 Jun 21  2021 bin -> usr/bin
drwxr-xr-x.  13 root        158 Jul 29  2022 usr
drwxr-xr-x.  21 root       4096 Jul 29  2022 var
dr-xr-xr-x.   5 root       4096 Jul 29  2022 boot
-rw-r--r--.   1 root  269906835 Aug 16  2022 rpm
-rw-r--r--.   1 root         32 Feb  1  2023 tmpconfig_3658661.sh
-rw-r--r--.   1 root         61 Feb  1  2023 tmpconfig_3658921.sh
-rw-rw-rw-.   1 root          0 Feb 27  2023 oom
-rw-r--r--.   1 root        142 Mar 24 15:00 Installer.sh.24032023-150059.log
-rw-r--r--.   1 root        142 Mar 24 15:05 Installer.sh.24032023-150542.log
-rw-r--r--.   1 root        142 Mar 24 15:07 Installer.sh.24032023-150743.log
-rw-r--r--.   1 root        457 Mar 24 15:09 Installer.sh.24032023-150957.log
-rw-r--r--.   1 root  658422784 Jun  6 16:12 datacollection-alerts_1.0.0-SNAPSHOT.tar
-rw-r--r--.   1 root         47 Jun 27 19:11 devnull
drwxr-xr-x.  11 appsone  4096 Aug 29 12:42 opt
dr-xr-xr-x. 298 root          0 Sep  8 15:56 proc
dr-xr-xr-x.  13 root          0 Sep  8 15:56 sys
drwxr-xr-x.  19 root       3100 Sep  8 15:57 dev
drwxr-xr-x.  40 root       1220 Sep  8 15:57 run
drwxr-xr-x.  11 root       4096 Sep 11 18:03 home
dr-xr-x---.  27 root       4096 Sep 14 20:43 root
drwxr-xr-x. 126 root       8192 Sep 19 11:50 etc
drwxrwxrwt.   5 root        116 Sep 19 12:09 tmp
drwxr-xr-x.   2 root          6 Sep 19 12:28 troubleshooting
drwxr-xr-x.   2 root          6 Sep 19 12:28 guide

Note: While creating the directory, know the below criteria's:

  • Single folder: To create single folder, provide the folder name in one string (there shouldn't be any space between the words) as below.

Example:

mkdir Troubleshooting_guide
  • Multiple folder: To create multiple folder, provide both the folder names with a space, as below.

Example:

mkdir Troubleshooting guide