+5 votes
214 views
Ubuntu, tips & advanced tricks 1/2

in Linux / Unix by (552k points)
reopened | 214 views

1 Answer

+3 votes
Best answer

View and reuse the most recent commands


To make our life a little easier the terminal has a feature to see a historical command used in it, for this we write: history . This simply displays a list of the last 1000 registered commands.

image


To have a better visualization and also for search effects we release our history in a text reader as less , for this we write this command line:
 $ history | less 



image


Now, to reuse any of these registered commands, we write an exclamation mark (!) Followed by the number that identifies the entry of the historical, for example:
! 195 , we would execute the following command: cd Documents /.

We can also browse the most recent commands by using the arrow keys on the keyboard.

Adjust the size of the images from the command line


With the GIMP image editor we can do anything but sometimes it is tedious to have to execute it just to make a size adjustment in some image. For a super fast manipulation we can use Imagemagick , it is a program that works via command line.

It does not come by default but we can install it via Synaptic, once installed, we open a terminal and execute it. Let's see how we shrink an image to half its original size:
 $ convert -resize 50% filename.bmp filename_small.bmp 

Pretty useful, right? Now let's see how to increase the size of the image twice as much (obviously there will be a loss of quality):
 $ convert -resize 200% filename.bmp filename_larger.bmp 

Search files instantaneously in Nautilus


What this tip describes is quite obvious but most do not know that it is possible, to quickly search through a list of files in Nautilus , we just start typing the keyword and a small text field will appear at the bottom.



image


Sharing Files


In this example we will explain how to share files safely and quickly with another computer in the same network regardless of whether they run Ubuntu, Windows or Mac. This is to create a guest account for the purpose of hosting shared files and directories .

one
We use Synaptic to install samba and libpam-smbpass packages, these are the necessary programs for file sharing and user authentication.

two
We create a guest account. This account will be used to host the shared directories and the other computers will log in with it to access this directory. To create the account, click on System -> Administration -> Users and Groups . Then click on Unlock and then on the Add User button. We give you as username: guest and we give you a password. We leave the rest of the empty fields and go to the User Privileges tab and mark Share Files with the Local Network .

3
We close the session and log in to the guest account, create the directories which we want to share, we can create even in the Desktop. Right click and select the option Sharing Options . We mark Share this folder, as well as Allow Other People to Write in This Folder , we give it a name and click on Create Share .

4
Now we have to create a permanent launcher in the account that we use regularly for the new shared directory so that it can be accessed in the future. Right click on the Desktop and select Create Launcher . We put a relative name like Shared Directory. Then we go to a terminal and write: nautilus smb: // localhost

We leave the terminal open and click OK in the launcher window, then launch the launcher, we must see the shared directories and in the dialog window that will appear we introduce guest in Username and the password that we assigned in the previous steps.

5
Now other computers on the network can see the shared directory like any other machine that shares files.

In the next tutorial we will continue with more features of this great distribution.


[color = # ffffff] See Part 2 of this Tutorial [/ color] [color = # ffffff] [/ color]

by (3.5m points)
edited

Related questions

+3 votes
1 answer
asked Jun 24, 2019 in Linux / Unix by backtothefuture (552k points) | 214 views
+3 votes
1 answer
asked Nov 18, 2021 in Guides by backtothefuture (552k points) | 113 views
+4 votes
1 answer
asked Jul 3, 2020 in Android Tutorial by backtothefuture (552k points) | 511 views
+3 votes
1 answer
asked Jun 23, 2019 in Android by backtothefuture (552k points) | 290 views
+4 votes
1 answer
asked May 14, 2019 in Android by backtothefuture (552k points) | 270 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users