> For the complete documentation index, see [llms.txt](https://securityshark.gitbook.io/oscp-prep/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://securityshark.gitbook.io/oscp-prep/linux-basics/command-line-fundamentals.md).

# Command Line Fundamentals

print working directory ; where am I ?

```
pwd
```

which user i am  currently logged in with&#x20;

```
whoami
```

change directory

```
cd
```

&#x20;go up one directory / go back one directory&#x20;

```
cd .. 
```

jump to home dir&#x20;

```
cd ~ 
```

go to last directory&#x20;

```
cd - 
```

&#x20;\[ concept of absolute path and  relative path ]

```
ls 
ls /etc/
ls kali/shark
```

&#x20;security

```
mkdir 
```

security

```
rmdir 
```

&#x20;  to delete recursively&#x20;

```
rm -r shark
```

&#x20;

```
ls  -la
```

create a file named  as hi.txt and put contents  inside quotes  inside it&#x20;

```
echo "hello" > hi.txt 
```

```
cp srcfile dstfile
```

```
mv src dst
```

mv used to rename files as well&#x20;

```
mv 
```

&#x20;is c opy paste&#x20;

```
cp
```

is cut paste&#x20;

```
mv 
```

shark.txt  looks / search eerywhere for specific file name&#x20;

```
locate 
```

&#x20;

```
updatedb
```

to change  password  by default of logged in users&#x20;

```
passwd 
```

passwd shark tochange passwrd of shark nameduser account&#x20;

to read file contents ; cat means to concat

```
cat file1.txt 
```

## Linux file permissions&#x20;

&#x20;

```
rwx rwx rwx
```

r ->4    w-> 2  x->1

```
chmod +r file1.txt
```

```
chmod 777 file1.txt 
```

&#x20; to add new user named shark&#x20;

```
adduser shark
```

Import files :

does not stores  password ; only stores users n account information&#x20;

```
/etc/passwd 
```

stores password in hasehd format look into details of both files&#x20;

```
/etc/shadow 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://securityshark.gitbook.io/oscp-prep/linux-basics/command-line-fundamentals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
