Answer and try out. File permissions Say you have a file called "myfile.txt". Write the command to make it readable and writable by the owner, but only readable by everyone else. You have a shell script named "backup.sh". Write the command to make it executable by the owner only. There's a file called "shared_doc.txt". …
Read MoreUsing basic commands Answer and try out: What command would you use to display your current location in the file system? Which command shows the list of files and directories in your current location? What command would you use to create a new directory called "projects"? Which command allows you to change your current …
Read MoreHere are some usefull linux links: Virtualization Tools VmWare Workstation/Fusion (free for personal use) VmWare is now owned by Broadcom You'll have to create a Broadcom account (free) main link Linux Images or prepared disks Easiest if you have Windows/Workstation: Download a complete ready vmdk file from osboxes ( …
Read MoreOpen Function Basics The open function documentation contains a lot of parameters The only positional parameter (file) specifies the path of the file to be read.
Read MoreAbout Special Parameters Special parameters are set by the shell to store information about aspects of its current state Example 1: the number of arguments of the current script Example 2: the exit code of the last command. Their names are nonalphanumeric characters (for example, *, #, and _). Variables are identified …
Read MoreAbout Parameters in bash A parameter is an entity that stores values. There are three types of parameters: positional parameters special parameters variables We'll discuss here only positional parameters. (the other types will be discussed in other posts) Positional Parameters These are arguments present you give a …
Read MoreShell Script A shell script is a file containing one or more commands You could type those commands individually on the command line Here's the content of my first shell script: 1echo Hello World! We have already encountered the [echo] command in Command Types Now I have to give my file a name: do not choose a name …
Read MoreUNIX philosophy Every operating system needs to interract with users. The original UNIX philosophy said (among other things): Write programs that do one thing and do it well. Write programs to work together. This philosophy applis also to the interraction with the user, and the kernel. In other words, the UNIX system …
Read MoreAbout vi vi is a screen-oriented text editor originally created for the Unix operating system vi was a visual mode of the ex line editor, hence the name Being screen-oriented means that vi would work in a terminal you would use to connect textually to UNIX like systems (so telnet and ssh would be enough to use it) The …
Read MoreLet's create our own systemd service. Our service program We'll use a simple bash script that endlessly outputs text into a log file: 1for (( ; ; )) 2do 3 echo "still running:" $(date) >> /tmp/myprog.log 4 sleep 1 5done Save this in a file, make it executable by anyone (777) and copy to /usr/bin: Service Definition …
Read More