Linux commands
To view what's written in a file:
bashCopy codecat filename
To change the access permissions of files:
bashCopy codechmod permissions filename
To check which commands you have run till now:
bashCopy codehistory
To remove a directory/Folder:
bashCopy coderm -r directoryname
To create a fruits.txt file and view the content:
bashCopy codetouch fruits.txt cat fruits.txt
To add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava:
swiftCopy codeecho -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt
To show only the top three fruits from the file:
bashCopy codehead -n 3 devops.txt
To show only the bottom three fruits from the file:
bashCopy codetail -n 3 devops.txt
To create another file Colors.txt and view the content:
bashCopy codetouch Colors.txt cat Colors.txt
To add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey:
swiftCopy codeecho -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt
To find the difference between fruits.txt and Colors.txt file:
Copy codediff fruits.txt Colors.txt