Skip to main content

Linux - show few lines in a file


# Using head - Print few lines (5 lines) from the top of a file
head -n 5 file.txt

# Using tailPrint few lines (5 lines) from the bottom of a file
tail -n 5 file.txt


# Using sed

# show from line 12 to line 23
sed -n '12,23 p' archivo.txt

# or just one (line 15)
sed -n 15p archivo.txt

Comments

Popular posts from this blog

Save Widows remote desktop credentials

First, START > All Programs > Accessories > Remote Desktop Connection Type in the computer name and clock OPTIONS Check off the box that says save credentials Now connect, and you will be prompted for your username/password. Enter them. Now you should be connected to the remote computer. Close out of the remote session. Method 1 Create a .bat file that has the following command: START mstsc.exe /v: & exit Run the .bat file and the remote desktop session should open and submit your saved credetials automatically. Method 2 Type mstsc -v it will login without asking credentials. Method 3 Save the session as a .rdp file (e.g: myRemoteMachine.rdp) and Double click the rdp file to open the remote desktop session without asking for credentials.