You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Use the /1, /2 etc flags to replace the first, second occurrence of a pattern in a line. The below command replaces the second occurrence of the word “unix” with “linux” in a line
sed: $sed 's/unix/linux/'
- Sed command is mostly used to replace the text in a file. The below simple sed command replaces the word “unix” with “linux” in the file.
Getting subdirectories in a directory:
- ls -l | grep ^d (^ matches anything with the following char/word)