View
97
Download
4
Category
Preview:
Citation preview
��������������� � ���������������������������
������������
����������� �������� ��������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������
���������������� ������������� �����������������������������������������������������������������������������������������
�� �!���"��������������� ������������������������������������������������������������������������������������������������
���������������� �����#$������ �����������������������������������������������������������������������������������������%
��&�'������������� � �� ����������������������������������������������������������������������������������������������������(
������������#��)���������������������������������������������������������������������������������������������������������*
��������+��$��������)������������������������������������������������������������������������������������������������ ��������,�� �$������������� ������������������������������������������������������������������������������������������ � ���� �!��������-�������������� �������������������������������������������������������������������������������� � ������.��)���������� �������������������������������������������������������������������������������������������������������� ������&�����������/�� ��#��)����-����������� �������������������������������������������������������������������� �&
��%��������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������
����/�)��������������������������������������������������������������������������������������������������������������������������������������0
������!������������� ����������������������������������������������������������������������������������������������������� �0������,�� �� ���������������������������������������������������������������������������������������������������������������������� ������ �!��#�+������������������/�)����������������������������������������������������������������������������� ��������1������������23�-��/��4� ������������������������������������������������������������������������������������� � ����&�5��/ �������������������������������������������������������������������������������������������������������������� ��
�����������������������������������������������������������������������������������������������������������������������������������������������������
���!�����������6���#��)���� ����������������������������������������������������������������������������������������%
�����!����� � ����������������������������������������������������������������������������������������������������������������� �% �����!�������7������������������������������������������������������������������������������������������������������������� * ��� �!������� ���������������������������������������������������������������������������������������������������������������� * �����!������8�������������������������������������������������������������������������������������������������������������� * ���&�!���������� ����������������������������������������������������������������������������������������������������������� � �����!������� ���������������������������������������������������������������������������������������������������������������� � ���%�!����������������������������������������������������������������������������������������������������������������������� � ���0�!���������������������������������������������������������������������������������������������������������������������� ���(�!����� � ����������������������������������������������������������������������������������������������������������������� � ����*�!������)��� ������������������������������������������������������������������������������������������������������� 0 ������!������)�7��������������������������������������������������������������������������������������������������������� (
���!����������������������#��)���� �����������������������������������������������������������������������������*
�����!���������������������������������������������������������������������������������������������������������������������� �* �����!�����7���������������������������������������������������������������������������������������������������������������� �� ��� �!����������������������������������������������������������������������������������������������������������������������� �� �����!��������������������������������������������������������������������������������������������������������������������� �� ���&�!����� ��� �������������������������������������������������������������������������������������������������������������� �& �����!������� ��������������������������������������������������������������������������������������������������������������� �& ���%�!�����)��������������������������������������������������������������������������������������������������������������� ��
��������������� � ���������������������������
���0�!�����+��� ������������������������������������������������������������������������������������������������������������� �% ���(�!�����#����������������������������������������������������������������������������������������������������������������� �( ����*�!��������9����������������������������������������������������������������������������������������������������������� &� ������!��������� �������������������������������������������������������������������������������������������������������� &� ������!�������� ����������������������������������������������������������������������������������������������������������� &� ���� �!����� ���������������������������������������������������������������������������������������������������������������� &�
� �!�����������6����������-������������ ���������������������������������������������������������������&
� ���!�������������������������������������������������������������������������������������������������������������������� &� � ���!������������������������������������������������������������������������������������������������������������������� && � � �!������#����������������������������������������������������������������������������������������������������������������� && � ���!���������������������������������������������������������������������������������������������������������������������� &� � �&�!���������-��������������������������������������������������������������������������������������������������������� &� � ���!������8#� ������������������������������������������������������������������������������������������������������������ &%
���!�����������6����������� ��������������������������������������������������������������������������������������&%
�����!������������������������������������������������������������������������������������������������������������������������ &% �����!�����8� ��������������������������������������������������������������������������������������������������������������� &0 ��� �!����������������������������������������������������������������������������������������������������������������������� &(
�&�!�������������������� ����������������������������������������������������������������������������������������������&(
�&���!��������7� �������������������������������������������������������������������������������������������������������� �* �&���!������)����7������������������������������������������������������������������������������������������������������ �* �&� �!������������������������������������������������������������������������������������������������������������������� �� �&���!������)�)������������������������������������������������������������������������������������������������������������� �� �&�&�!������)#�������������������������������������������������������������������������������������������������������������� ��
���!���������/�����������#�������������������������������������������������������������������������������������
�����!�����7)�������������������������������������������������������������������������������������������������������������� � �����!�����7)��� ������������������������������������������������������������������������������������������������������� � ��� �!�������-���������������������������������������������������������������������������������������������������������������� �� �����!������� ����������������������������������������������������������������������������������������������������������������� �� ���&�!�������� ������������������������������������������������������������������������������������������������������������� �� �����!������ ��������������������������������������������������������������������������������������������������������������� �&
�%�!�������������� ����������������������������������������������������������������������������������������������������&
�%���!������"���������������������������������������������������������������������������������������������������������������� �& �%���!������������������������������������������������������������������������������������������������������������������������ �& �%� �!����� �+�������������������������������������������������������������������������������������������������������������� ��
�0�!������������������� �������������������������������������������������������������������������������������������������
�0���!�����7���������������������������������������������������������������������������������������������������������������� �� �0���!��������+������������������������������������������������������������������������������������������������������������ �% �0� �!������� ������������������������������������������������������������������������������������������������������������� �%
�(�!���������� �� ������������������������������������������������������������������������������������������������������������%
�(���!������"�� ������������������������������������������������������������������������������������������������������������� �% �(���!������������������������������������������������������������������������������������������������������������������������ �0
��*�!���������������� ������������������������������������������������������������������������������������������������������%*
��*���!�������)������������������������������������������������������������������������������������������������������������ %� ��*���!������ �� ���������������������������������������������������������������������������������������������������������� %� ��*� �!��������������������������������������������������������������������������������������������������������������������� %� ��*���!�����/���� ������������������������������������������������������������������������������������������������������� %�
����!�����������6������/ �� ������������������������������������������������������������������������������������%�
������!������"������������������������������������������������������������������������������������������������������������ %� ������!���������������������������������������������������������������������������������������������������������������������� % ���� �!����� ������������������������������������������������������������������������������������������������������������� %
����!�������������� ������������������������������������������������������������������������������������������������%�
������!������ ������������������������������������������������������������������������������������������������������������� %� ������!��������� ����������������������������������������������������������������������������������������������������������� %� ���� �!��������������������������������������������������������������������������������������������������������������������� %�
�� �!��������-�� ����������������������������������������������������������������������������������������������������������%&
�� ���!������� ����������������������������������������������������������������������������������������������������������� %& �� ���!�����7)����������������������������������������������������������������������������������������������������������� %& �� � �!����������������������������������������������������������������������������������������������������������������� %�
��������������� � ��������������������������
����1���������������������������������������������������������������������������������������������������������������������%%
���������������������������������������������������������������������������������������������������������������������������������������������������
����2�����6�������������������������������������������������������������������������������������������������������������������������������0
����2���������������������������������������������������������������������������������������������������������������������������������0�
�� �2������� ������������������������������������������������������������������������������������������������������������������������������0%
����2�������7��-"7������������������������������������������������������������������������������������������������������������0(
��� ����������!��"���������������������������������������������������������������������������������������������������������������������������������#��
&���!�����������������������������������������������������������������������������������������������������������������������������(�
&������������ ��������������������������������������������������������������������������������������������������������������������������(
&� ������������������ ����������������������������������������������������������������������������������������������������������(&
&� ���2���������������#��������������������������������������������������������������������������������������������������� (&&� ���2���������������7)� � �������������������������������������������������������������������������������������������� (&&� � �2������������������� ���������������������������������������������������������������������������������������������� (�&� ���2�������� ����������� �:�#;��������������������������������������������������������������������������������� (�&� �&�2�������� ��������< ��� �:���;�������������������������������������������������������������������������� (%
&���=���������������������������������������������������������������������������������������������������������������������������(0
&�&�������������������������������������������������������������������������������������������������������������������������������((
$��%�!&��'��()������&������������������������������������������������������������������������������������������������������������������*��
����,�/���������������������-���������������������������������������������������������������������������������*�
����,�/�����,���"�� >�/ ���������������������������������������������������������������������������������������������*�
�� �,�/����������� >�/ ����� ���������������������������������������������������������������������������������������*�
��������������� � ���������������������������
1. Introducción a UNIX
1.1. Historia de UNIX ,����4+������ ������������������������ ������� ��?���*�,������������������ :�;@
�� ��������������-� ����/6/����6���������������-�������������������:������������� �������� �
� �� ������� �� ��� ����;@ �� ������ �������� �� �������� ����������@ ���-���� 9�� #���� - ���� 9�� ���
/��������/��� �"��������� �6����� ������� ���9������� A����
2� �(�(!� �"����� � :����� ����; ������ � �� ������� ������� ��'�,B�!� �� �� ��9���=2!
�=�C%@9�� ��������������#���:� ����������;���������������:�(%*;�����������9����=�C��3�*-��
� ��� � ���/�� ����� 2��� ������ �/ �������� � ������� ���� ���������@- ���/ ���+���� �� ��
��+�6��� ������ ����,3��
2��(% $� ���%���"��������� :6�������"����� ;� ��+�6������+�������@-�������������/�
�� ���� ��+�6�� D ������� �� �� %* �� ������ ������� � �� ���� �� �< ��� �� � �#����@ - ��
������������#���+��������#�������������� � ������������@ ��� � � ��+�� �"�������=������
�����������+����������������������������
D #�� �� �� �� %*@"����� ������ ������� ���&���'� ����(���� $���������� � )��$*� ��� ��� ����
�-�� �������'�����#������������������������-�����'�����+��'�����+-��$ ���������������
��������� �������������/�������@����$�����#�������������4������������������������ ����������
������@������ ��0*��#���������������� #�6�������������������+���������� �������,-��.@9��@
+�������+��@���/ ���������/�#���������/�����������������@- 9�����������6������ ���������
����������������,B/ ��������� +����� ����������������������������
+������ ,�!�������� %�������� -�.���������
�������� �� �������'������ � �����-�/0
�� -��)��������1*� �� �������'������ ��$ �����
$���-�231� $�������%������"� ��$ ��"�
�.� ���� =�#���������-��$ %�0444
�%�.� ������ �����"���� � ������ �����"���
��-� "���� ������5�-������� � �������)��+��+��� � ����/0
6,7�.� 6�(����7,��&���� � 6�(����7,��&���
�� ��� :�</ ���; ��$-� � ����/0@�����8��"�8�,�(��,�8�,�(�����
2�����$� :�</ ���; ��$ � ����/0
-�� ��$� :�</ ���; ��$ � ����/0@��"�@�����@6,@����
�� ����������������������������������������
2������������������������+���/�A�����������������������@�����@������ ���� ���(��9�
� � ����-������/�����#���+��������#���������������'���"#������ ������������������� ����
#�� ��/0-0/���@-#����������������@ �� �����@9���� ��/� �� � ����+��� � ��������� �����������
����������/���/������� ������#��� ���������-+������@����� �$� ��� ����?�$�������������
�����������������
��������������� � &��������������������������
2� �((*�� ����� ��� ����������6��� ���� ������ :������������;-��������@9�� �� ��/ �� ���
��������$������/�����((��������������������/:*�*�;��������������:/0�D����������������
������ ����$� ������@+���� ���������� �� ������ ����� ������ � ������ ��� ��� �$��@ ,���" ��
��/�A�+������-�9��������)���� ����@������ ������� ��< �����?��@-������/�A���� �"������
�� �� ����������� ������ �� �� +�� �������� D�4@ ���+�� �� ����� �� ������/������� �� ,���"@ ��+������ �
�������������������@���������4�������#�������@-��������< ��� ��� �#����E�/0@0/&@$���������"�@
�����@����-���������,�(���,��,B/ �����+� �������� �������������,���"��� �������
2��� ���,���"������������</ ���:���������)����� 9����������A ���� )��)������+����;@
����9�� ��+�� �� ������ ������ ������� ��!������������ � ��"���"����#� 2�� ������ �����+�
#� ���#4,���"E��#�7���������-��������!� 9�������������#��� �-��������/��� ��������� ��:��9��
���)�������� �����������������)���������������������@����6��� �@� �<� ��@9������������� ���
�� ����;@������� �����������F�,�������@����6��� �@����#���@��������/������� ��������� �9��)+���@
�����/ �+������/���� ����+�#�����6������� �����+�����9��������������#�����-��������/�������
������
/�����!�� �� ��������)�������
��������-�� �� ��� 5��������?������� �������� ��������-��� ������
$���� ��#�3�� ���'��)���#���$������������#�/� ����2���������������)���� �������������� ���������� ������ ������������ �6�
%��6���=������/ ���� ���@��"�-�����@������������������� ��� ������/� �������� ����������������9����������
����&(������ ������������������������� )��7���������/ ������������������ E������@��6���@� ���� �����������-������$����������+��
������� ������ �-� )��������;����#�� ��� ���� ����-���#�+�������� ������@9����� �-�+�������������+���-��� ������
�� ����� ���&�� ��������+����������� ���������.��������������������� #�� ����� �
�� ��,,�� ������,�(��,�
�� ���,��� ������������+���������������������������� �
�� ��<���� '��)�#�� ����������� ����@����������������=��3G ����7��
�&�� ��� ������,�(�����
������ ������ �-�� ��������#��� �������6�@���������������-��������A������=������/ ���� ���@��"�-,�(��,��
;����������� ��� .�� ����������� ����,����,��'�
$�.��� ��� ��������#�����������������9������ @&H�
$-���� ��� =���?����������� ������������=��3G ����7��
����������� ���!/�����<�������9������ @&H-������������)���������������#������-�������������������#��)�����
�� ���$�� ���"��������������������������
�01-2
D ���� ��9��������/6�@����-,���"@������������������������ ���� )������-)/ �����������H� � �������������������������������� �H@-��,���"����H� �� ����= ����� ���������������� �����������#�.H�D�4@���������������-,���" ��$@��#���9������ ���#���������������� �����,���"@��9����/�A����������� ������������"� �����������,���"�
��������������� � ���������������������������
1.2. Introducción a los sistemas UNIX ����������������������������������-����������@�������@9������������������������������6�����
���+������ ��������������@-9����������+���@�� ��������#��������������@�������6�������
��$��#����������������� � ���������������������#���9�� ������������� ��������� �� �$�
����������9�������#������� ���������������9��������?�� �������D�4@����������������������
���������������������������������2������������� �"�����������#����������������������D�����@
�������������+��$���+�����@��#���9��@�����@ �������������#���������������������������
����+�@����������������� ��@����+���������������
����� ����� ������+������� ����� ��� ����� �� �������E ������� ���� �� - �������������� ,��
�������������:��/�A�����/��� ���/���������7������������;����������� �������)������ �$��� 9����
��������@���� ������������� �����,������������������ ��9��������+�9�����#�+���� ��������
9��� ����������������/6���� ���"���+���4��
����/6�������9���������������������� �$�� ��� ��- ��� ��������� ���������@
����9�����������������#��� ��������A����� ����D ��� ��-��� ������9��� �� � �
�� ����@-����-#����������� �$� ����� ������9�����������)�������9��������-��/6���
� �D���A��� �����6� ����������� ��� ��- ��#��������� ��� @��#���9�� �����+�����
�6�������� �������������@���� ������ �������� �����-���� �$�������������
!���� �������� �� �������� ��� ����@ � ������� 9�� ��/���� )��� �� ������#������� �� ���
���������� �� ��������� ������� :���� ���@ ���� ;- ����� ��������� :����(���; !�� � ���/�� �� ������
�����������#�����@-��� � �������+�������9��������� �������������/�����������!����)�����
+�������������������@��� ������9�����+����� ��#��������� ��������@#��)-� ������9��
�� �$���� ��� �$���� ���������������� ������� �� �� �������@��#���9�� �������� ��� ������ ��
��������������#�������:#��)����@���+���@����;�
1.3. Conexión a un sistema UNIX D��������� �$� ����� ������� ������������ 9���������� ��� ������,���"@�"������� �����
�� #���� �� ��������� �� ��9��� ,���"� , ��� )/��� �� ���A� �� ��� ��� ��� �� �� �� ������� � ��
�����������9���������������������� ��9���,���"���6������������-�/����� ������ ������
������ ��� � ,��������9�� ���������� �� ������ ��� ��� ��@9�� �� �� ���+��9�� ��� ������� �� �$�
����"�����������/�� ��#���������������������������-� ��������,���"@��� �$���� ������� ���� ���
�/��� ����� ���� ���+�� �� � ��/�A� t el net � ��� �6��� �@ �� G ����7�@ ������� � ���+��
c: \ wi ndows\ t el net . exe@-�����"����� ������ ��� ���=� +��#�����/���� ������������ ��������
9�����������������@-��� �)�����������#������� ���������������= ��,�2��������#������ �����
������������ ���+����� ���
t el net pol i f emo t el net 192. 168. 2. 100
�� �� �� #��� �� 9�� ��� ���������� ��9��� ,���"@ � ������ ��� ���� ������#������� ,
��9���,���"���������� ���/�������������������6���/��������- � /����� E
Li nux 2. 0. 30 ( pol i f emo. di esi a. uhu. es) ( t t yp0) pol i f emo l ogi n: _
��������������� � %��������������������������
D9�4�����/����� ���/����������-�� ����� ����D)��,���"������9�������/���� ����(����
Li nux 2. 0. 30 ( pol i f emo. di esi a. uhu. es) ( t t yp0) pol i f emo l ogi n: l l or ent e Passwor d: _
D ��� �� � ����(��� ����������� ����� @ ��#���9������������� �9�� �����/����@ ����
�� ����� �4 �� ����� �������������� .�� ����� �� ���� � ���� �� ���� �� ��������@ ���������@ �� ��@ ,���"
�������������6���������9�� � ��������������2�� �����9�������/���� � ���/����������@�
���������� �����@-9��� ���/ ���� �������9�� � ��������������� ���/�����������
����$����������� �������������������$���/6����A �
D���� �� �+� � �������� ��/��������� ������9�� ������������������������� ���'�� ��
�� 9���� �������@ ���� 9�� ��/� ��+����� �� ������������� H�������H �� �+�� :������� �� �������
��������E shut down@ hal t @ r eboot @ ����; ���� �� ���������� ��������� �� ���������� �� �+��� �
��������� ,���" ��� � ������������� ������@ ��� �����+��� 9�� � ������ �� ��)���� ��#� �?�� -
�A����� ������/ ��� 2� � �����9�� ���)-����������� ���A� �� ��� :��� �6��� �������� ��� ��;@
<�������� ���������� ����� ����"���@ - 9�� � ��������� ,���" ��+���� ��������� ��9�� �+�����
����������� �,#������������/������ ������������������������ ���������exi t � l ogout I
�����A���������+�������������� �,��+��������� ���������6��� ��������������� ���� �$�
��#����������������� ���E
Li nux 2. 0. 30 ( pol i f emo. di esi a. uhu. es) ( t t yp0) pol i f emo l ogi n: l l or ent e Passwor d: Li nux 2. 0. 30. Last l ogi n: Fr i Oct 15 12: 20: 22 on t t yp0 f r om j mal . di esi a. uhu. es. No mai l . pol i f emo: ~$ exi t l ogout [ pol i f emo: 23: r emot e di sconnect ]
1.4. Introducción al interfaz de UNIX ,�����#$� ����� ������:-@�����������@��,���";��� � �>�������������� ���@�����������������
�����������'�C=������ �>�������������� ��� ��� ������� �����/���������9�� �#���<� ������� ��/�� �
������E�6��������+���@���6�#��)����@����2���-����������������9�������������!&������34��&���
3����4��&��: ��������9��'�C=��;@�������@9������ �����������/��l s-LS�
����$9������������ ������@�������������� �������2 �����������4�/� �9����������9��
� ���������� ������9�������/�����������2����4�/� ���� ���� +����� ����+�������EJ@K@L@M@N�D
����� ���� �� ������ ����� +�� ��#������� ���� � ���/�� �� ������@ � ���/�� �� ��9���@ �
������������� @����D�������)�������������9��� �4�/� ��� ��������HNH�
,��������������������������������+� �@-������ �������������"��-#���������������� �E
��������������� � 0��������������������������
comando f l ags ar gument o1 ar gument o2 ar gument o3 . . .
• comando��� ���/���� ������@-��� ������/����������������� ������� 9������@
���� ����������<��� ��
• ,��f l ags��� ����������� �����������6����������#�������9��)���9��� ������#����������
��#���������������@#������@������� �+���� ��������� ��+�������:C;��+����@����������@����
���:����������9���-<��� �-���<��� ������#�������;�
• ,��ar gument os ��� �� ��� ���/�����#��)����@- �� ��#����� ���/6���� :#��)����@ ����; ��/�� ��9��
������ �������
2 �<���� ������� - ������ ���@ �4 ���� �� ����� ��4 ��� �� ������� 5���� �� �6��� �� 2
������ l s ����� �� ���� �� ��)���� �� �� ���������� :�� �� � ������� �� ����� �����������';� �� �����/����
���� ������� ������l s@�/�������� �������#��)����E
$l s a. out * mai l / mbox mi n* mi n. c nsmai l / p/ t mp/
D�4 �� � �� �/������ �� ���/��� �� �� ��)���� �� ����������� ������� �/����� ��#������� ��� �
��� �$���� ����#�����- l E
$l s - l t ot al 20 - r wxr - xr - x 1 l l or ent e user s 4261 May 4 10: 40 a. out * dr wx- - - - - - 2 l l or ent e user s 1024 Jun 1 11: 09 mai l / - r w- - - - - - - 1 l l or ent e user s 2308 Jun 3 14: 07 mbox - r wxr - xr - x 1 l l or ent e user s 5643 Jun 3 14: 54 mi n* - r w- r - - r - - 1 l l or ent e user s 1296 Jun 3 14: 54 mi n. c dr wx- - - - - - 2 l l or ent e user s 1024 Apr 7 1999 nsmai l / dr wxr - xr - x 2 r oot r oot 1024 Jun 8 10: 46 p/ dr wxr - xr - x 2 l l or ent e user s 1024 Apr 15 15: 06 t mp/
�������������������� �$�� ����#�����- a�������� ����)������� ���E
$l s - a . / . l ess . net scape/ mbox . . / . l essr c . pi ner c mi n* . Xaut hor i t y . mc. hot . t kdesk/ mi n. c . addr essbook . mc. i ni . xsessi on- er r or s nsmai l / . addr essbook. l u . mc. t r ee a. out * p/ . bash_hi st or y . ncf t p/ mai l / t mp/
B�/�A�����������/��� ������#������������ ��������9��� ���������/�� ������������6�����@
-���� 9���������:- a - l �� ������9��- al -�� ������9��- l a -�� ������9��- l - a;E
l s��/�A����������+������� �� ���/����� ��)����9�� ��9�������������� ��� �6��� �@ �� �� �
9���������� ��#��������� ��mi n. c-a. out E
��������������� � (��������������������������
$l s - l mi n. c a. out - r wxr - xr - x 1 l l or ent e user s 4261 May 4 10: 40 a. out * - r w- r - - r - - 1 l l or ent e user s 1296 Jun 3 14: 54 mi n. c
��������� ����"��-��� ������������������������������ 9�����������������������
������man������ ������+������� ���/�������������������6��� �@��9�������������� ����"����
l s@�����/����man l s�D�����������"��������� ����#���������/��� ��������9�����������������+�
���������"����� �$��� /����������@� ���- ���� ��-?�
1.5. Mantenimiento de la clave O�/����9���������������������� ����9������������� ��� �����������������2
������������������ ������-���������@-���������������E
• '��������� ������������
• '���#���������������� � ���
2 �������� ��������+���4/�� ����9�������������� �$�����������/�����������2"�����
��#����� ���A����� �� �9��9�� �������� ����+�� � �� �� �� ������@ ������ ����������A�� �� ��
� /�H#��� H�������@�� ��������/ ���/���������������������� ���D�����@��/����������������
9��)-� �����-#��� ��������+�������6��� �@������/��4������ �$�� ����� ��+����������E
• ������������ ��@����������/��6�������<����@����
• .��)�@������ ������������?��������������� 9����#��)����������
• ���/������� 4�� �@��������@������@�������� ����
D�����@�������/������������ ��@����/������� �$���� �������� ��������,��6�����
�� ��� �� ���/�������� ��� � ����� ������ �� ���� :�-<��� � - ���<��� �;@ �<����� - �4�/� ��� 2
���/ ����9������#4�� ������������������ ���@������� ������+����2����)��������������������
������������ �$�� ���H#��� ��H:�>�����;I�������@���� ������@���������9����� �������������
��� ���������������������������������������������������/ ������/���� ���!�����
�����������������������������/����������@��/�A������/��������������� ��@���� ���6����9��
�������� ��/������������������5����������)��� ��
���������� �$����������2��������� ��������passwd�2 ���������������@�������� �+�9��
�������$���� � �����+�: ��� �� ���������������� ;E
$ passwd Changi ng passwor d f or l l or ent e Ol d passwor d: _
���������������������������� � �����+�������������������@-� ��������������E
$ passwd Changi ng passwor d f or l l or ent e Ol d passwor d: I ncor r ect passwor d f or l l or ent e. The passwor d f or l l or ent e i s unchanged.
��������������� � �*��������������������������
$_
2������������@�������������� ��������������2 ��+����������������/�� ����� �� :������
�������������� ��� ��;�
$ passwd Changi ng passwor d f or l l or ent e Ol d passwor d: Ent er t he new passwor d ( mi ni mum of 5, maxi mum of 8 char act er s) Pl ease use a combi nat i on of upper and l ower case l et t er s and number s. New passwor d: _
�������/������� ���A/� @����������������6��������:������������(���@�����������9��'����� 9;-
�� ��������� ����� ���=� ���������@�������@�� � ���������@� ��+�������������������� � ��
:��������)�������#������ ��� ��@-9��������� �9�������/����;E
$ passwd Changi ng passwor d f or l l or ent e Ol d passwor d: Ent er t he new passwor d ( mi ni mum of 5, maxi mum of 8 char act er s) Pl ease use a combi nat i on of upper and l ower case l et t er s and number s. New passwor d: Re- ent er new passwor d: _
��)����� ���� ����� ��@)/�������������-passwd�������������6���������� ��/����
� ��E
$ passwd Changi ng passwor d f or l l or ent e Ol d passwor d: Ent er t he new passwor d ( mi ni mum of 5, maxi mum of 8 char act er s) Pl ease use a combi nat i on of upper and l ower case l et t er s and number s. New passwor d: Re- ent er new passwor d: Passwor d changed. $
������������#�������-��� ���� +���#������@� ����������/��� � ��@�������������6���
�����:����"�'��� A������"B���'����� 9;-��������������$9����� ����� � ������:-�����A����������9��
������� ;�
1.6. Sistema de ficheros de UNIX 2�����@ �+� 9����������'�C=��-G ����7�@ ��#��)��������+��$��������������@#��������
��/� @����@��#��������A����@���������"�������������H��������������H@����9����������+��$���
����� ��/� @ ��� �� <��� �4$� 2 ����� �� ��������� ������������ �� )�� �� ����� �� ��/� �� �� ��
����������� �� +�� �������� �� ��/� ������� � 2�� �������� �� �������%��&��� ��� �������&���� !����
�/�������� �$� ����)����+����������������������@��/�������%��&�������������&���@9������������
��������������� � ����������������������������
�/��� ��+������� �������������� �������� ��)�������2���- ����������������� � �������
�"��4/ ��@ ������ ����� �� ���9�����@ ���� �� �"���� � �����������@ ���9��@ �� ���������@ ������� �?� �
��������#��)�������� ����
��� ��� �$�� @ �� ������� ���� �� �� ������ ����� �� �������� �� ������������I ��� �� �� ���
������� ������������
,�� ������������9�� �� ������ ����� ���@ �� ���������@ <�������� �� 9�� ����� �� ��9��� �����
!���� ��/6��� �� #��� ����� :��� �6��� � ������� ��� ��;@ �� ������� ����� � ������� �� �������
��������� �� ��� ��������#��)������ ��9�������������
1.6.1. Organización de archivos
2������"����� ������������ ����#��)�������)����E
• =����������
• .��)�������������
• .��)���������� ��
,��#��)��������������������� ���������-���+����,������������������������� ���������
����/� @��#���9�� ������������� �����#��)����-�����������������,��#��)���������� �� ������������
�� ����
,��#��)����:���� 9��������;��������#���������������/���2 ���/��������)����������������
�� 9���� ���/������ �� ��������@ ���� �� ��������/ � �� ��� �$� +������������ 9�� ������ ��+��#�����
������ ��� ��� �+���� ����6�� ��� �$� �� ����� ����- �<������=�/���� �������9�� �� ��#������ �����
�-<��� �-���<��� ��
,�����/�����#��)������� ���������������"��������,�"�����������#��������������:�;-��
�������� �� ��������@ - ��� � ��� �$��� �� ������ � ���� �� ����9���������� � ��)���� ��� �6��� �@ ��
��)���� 9�� ��������� ����+� #����� �� ���+��� �������� �� ��+�6� ! ��� �� ����� �"������� H. cH� 2� ����
�������@ �"���������������������#��������'�C=��-����@-9����'�C=�� �"����������/ �+����
:��9�����A��4��������9���"����;@-���������+��#������������ ���/ �I�4 �����+����6����/ ����
'�C=�� ��/�� ����/ �+��������� �"������� �� �6����/ � :. COM@ . EXE@ . BAT@ ����;�D�����@ ��'�C=�� �
������������ :�; �� � ������� ��� �� �� ����� � ���/���� �"�������@ ����������� ������������
��� �$������������� ���/���
B���#��)����������������/����� �������������� +<����������� :�"������ ���������� �4$@9�� �� �
���+��;�2 ������������������9��)-9����+�������� �4$)������������#��)����� ����:���";���
���������� ������� ������#��)���@�������/�� ���������������������9�� ����������@������������
/�� ��������:/ @����";@ ��+�������� ���/���� #��)��������6��� �@� #��)��� l i bvga. conf i g9���������
����������vga �������� ����������et c@����� ��� / et c/ vga/ l i bvga. conf i g� 2 ����������9���������� ����
�����������������������"&����������������"&��������������D�4@/ et c��� ����������������/ et c/ vga�
=������������ �������������@�"������� �����������4$:/ ;@�"������������������������� ��EH. H-H. . H
• 2 ����������. ���9��� ���� ����� ����������9�� ����������2������@9���� ������/ et c/ vga/
9��/ et c/ vga/ . / �
• 2 ���������� . . ���9��� ���� ����� �������������� 9�� ����������2������@9���� ������
/ et c/ 9��/ et c/ vga/ . . / �
!�������9���������#��������)����������� ��/� ��������������������������������������#���
����������� ��)����������"���� �9���������������"&�����������'�"&�@���������������������������������
��������������� � ����������������������������
�����C��!����� ���������������#������.@�������9����&�%����� ����������.@����� ������9����������
.�2������������)-��#����������������������#����@��#���9����<��������������#����������/����
��)���@��������9�� ���)��������/������)������ ���������������#�����
B�/�A��������������#��������������������� ������������� �2����� �9���������������&��
����&���@#���������&��� ����&�@9��������$���� �����������4$:/ ;�����6��� �@��� ���������������#������
/ et c@������������9��� �����vga/ l i bvga. conf i g -/ et c/ vga/ l i bvga. conf i g�B�/�A����������� �$�. -. .
�������� ���������6��� �@��� ���������������#������/ et c/ ppp@����9��� ����� . . / vga/ l i bvga. conf i g -
/ et c/ vga/ l i bvga. conf i g
2 ������pwd:��� ��(��&� ����������';�����/������ ����� ���������������#�����2 ������cd
:�"� �����������';���������/��� ���������������#���� 9�������������+�����������6��� �E
$ pwd / home/ l l or ent e $ cd . $ pwd / home/ l l or ent e $ cd . . $ pwd / home $ cd / et c $ pwd / et c
!��������������������������������������������@ �������������"����2 ����������"������
�����������������������9����/6� ������@������9�������)����� 9���������������������@-���+<�
���� ������ ����� ������ A : �����9�� �"� 4�������� � ������;����� ����� � ����������"��� �� ��
����������� � ��������/��9�� � ������- ���� ���������� ���������� / home@6������� ���� �������
�������� !� ��$9�� �� ������ ���� ������@ �� ���������� ��� ��#���� �� ��"���� D�����@ ��� �$��� �
������cd������������@� ���������������#������ �������� ����������"����
2� ���� ������ ���� �"����� �� ���6���� �� ����������� 9�� ������ �� ��� �����4#���� 2���� �����������
��������/��������������������@������+���� ��� ����� ��9�������� B/ �
/���������� �'��(�����
/ =����������4$�!����������� �������
/ bi n �����������+���
/ dev !������� ��#��)���������� ���� ���������� ���������������
/ et c !�����������������)�����=����� ��#��)������� ���:passwd@shadow;- +�������+���9���� �
��� �$� ������������
/ home !������� �������������"����� ����������
/ t mp !���������)���������� ���
/ usr !���������)����-���+���������
/ usr / i ncl ude !������� ����)�������/����:#i ncl ude;�� ��+�6�!�
�� ���(��������������"&��������&)�����
��������������� � � ��������������������������
1.6.2. Localización de comandos
B���� ���������������+���9��������� +������������� ��/� ��������������������������
9�������/�� ������� ����������@�"���� �9�������������&*���� +�,����:����� ���������";9��
�������� �� �� ���6���� �� ���� ����� �� ������ 9�� ����� �� �������� D�4@ �� �����/���� �� ������ ���
������#��������@� ������/������ �������� +����� ���������������� �������� ��)��� �����������
+���� �����@ ��6����I����@+������������6���������
!����9��������6����������+���������9���������������� ������������� ��/�A���/����
������ ���:������� ������������� ��� ��);@��� �$���� ���/���� ������������� :. ;�����6��� �@���
�������� �mi _pr ogr ama@�����/���� ��+������ 4��E
$ . / mi _pr ogr ama. c
1.6.3. Comodines y caracteres especiales
,�� ��������� :(��������; ��� �������� ������ �� 9�� ������ �� ������#��� ������� �� ���/��� ��
#��)���� :��/�A� ����%)�"����;� 2� ���)� �������� ������������ ������#��� ���� �+������� +<�
���������)�����/�����#��)����9�������� +��������4�������<������6��� �@����� ��#��)����9��
���+��"�������. c����������������/ ������������ �$� �����������@9�������������9������������
�������������E
• ,�������+����:P;����������� 9�����������:�+� 9����'�C=��;�
• 2 �������� :Q; ����������� 9���� ������������������@ ��� ����� ����������4 :�+� 9�� ��'�C=��@����������� ��������� 9���������� �����;�
• �� ���6���� �� �������� ��������� ����� ����)���� :RS; ��������� �� 9���� �� �� ��������������#���������� ������)���������� �$�� �������] �������� ������)����@ ���/�������������
� ��������� ����������6������������[ �
• =����������������������������)����:RS;-������������+����:C; ����������� 9������ ���������� �� ��+� �� ������ ��� ���������� ������#����� :��� �����A����;@ ��+<� � �����D�!���
����� �$�� +������������ ������)����������������� �����@ ���/��������� #�� :����
��[ ;@� ���������:�����A���[ ;�
• B�/�A��������������#��������6��������������9������/��#���������� ���/����#��)����
��� ������������������:! ;6���������A���[ �
B�����������/� ����������������/����,B/ ������� +�����6��� ���
��������������� � ����������������������������
+��� �� �'��(�����5����&����������������(����6�
* B���� ����)�����
? D��)������-����/���� ����+���������:��� ���������������#����;�
* . * D��)����9�����+���������� +�������������/���
[ a- z] * D��)����9��������$������ ������<��� �
* . c D��)��������"�������H. cH
copi a?. c copi a1. c@ copi a2. c@ copi aA. c@ copi aa. c@ copi a_. c@����
copi a[ 123] . c copi a1. c@ copi a2. c@ copi a3. c�
copi a[ 123] . * copi a1. * @ copi a2. * @ copi a3. * �
copi a[ 1- 5AB] . c copi a1. c@ copi a2. c@ copi a3. c@ copi a4. c@ copi a5. c@ copi aA. c@ copi aB. c�
copi a[ ! 123] . c B���� ��copi a?. c@�"�����copi a1. c@ copi a2. c@ copi a3. c�
copi a[ 123! ] . c copi a1. c@ copi a2. c@ copi a3. c@copi a! . c�
copi a[ . c 2 ��)����opi a[ . c�
copi a[ ] AB] . c copi a] . * @ copi aA. * @ copi aB. * �
copi a[ - AB] . c copi a- . * @ copi aA. * @ copi aB. * �
�� ���-���.�%���������������"�%��������������'�������&���������'�"*�����
D������� �����������@�"������������������������ ��@�������@9�������� +<���+��#����������
�� � ���A���������������@-@��� �����@ ������@ �������� ��� ��� �$��������/�� ��#��)��������
�6��� �E�������@>@&@$@�������/�����@-��9��������������/ �@���������� �$� ������ �����������
������ 9�� 9������� ��� �$� ���� �4�/� �� ���� ���� ��@ �/����� �� ��+��#���� ������ � B������ ���
����/� �����E
• 2������ �����/���������� ����� �$��� ����� ����� ��:´ ;�
• ������9���������������4�/� �������� ����������+��#���������� �,�)������������������
�4�/� ���/����������:\ @���&����";�
��� �6��� �@ �� ��#������� #��)��� con* ast er i sco ������� �����/�� ´ con* ast er i sco´ � /���
con\ * ast er i sco�
=�����#����@���������4����������)�������������� ���A���������������@- �����������
����� ��� ���#����$���A����
1.6.4. Ficheros especiales
,�� #��)���� ������ �� �� ������ �� ����� ��#�������@ ���� �� ���������� ������ ���
!������������#��)���������� ��E
• ,������"�����������9�������������� �������������#��)����������������������������������
�� ��/� ��������������B����� ���������#��)�������� ��@����� ����������������#��)������
����������������� ��)����@ ��#���9�� ������#����� � ����������� #��)���@9�������#����
������� ���� ���@-9������#����� �����#��)����
�D )��)�������������/����������T:����������������� �;��������������� �� ��������� +���������� ���/����U�����V
� ��������
��������������� � �&��������������������������
• ,���������&����������������6� ���������������#A�������������� ����������
2���������� ������#A����������6�������#����#��)���������6��� �@ ��� �����6������
#��)��� ��� / dev/ t t y@ �� #��� 9�� �� �����/���� ��#������� �� ���� #��)���@ ��#�������@ �� ��$ ��
������� �� � �����@ �� ������ �� ��� � !� ����#A���� ����� ��� � ����� #��)���� ������ ��@ 9��
������ ������������@-����� � �� ���� ��� �� � ���������� / dev� ,B/ &�������� +���� �6��� �� ��
#��)���������� ���
/��������7�� �'��(�����
/ dev/ t t y B����� :����� ;�
/ dev/ hda ���������������
/ dev/ hda1 ���������������� ���������������
/ dev/ hdb ��+�������������
/ dev/ f d0 ������������������# �"�/ ��
/ dev/ nul l =������������ �:������ ��#�������;�
/ dev/ r am '�����1D'�
�� ���/���.�%���������������&�����
!���� �� ���� �� �6���� �� 9���� ���+��@ A��� ����� ��� �$� ������� ���� ������������E ��&�����
��&)����@ ���������&)����- ������������������
• ,��&�������&)������� ��������������� 9��� ���+������+� �������������@ ��#�������9��
��/���������
• , ������� ��&)���� �� � ����������� ��� � 9�� � ���+�� ������ �� ���� ����@ ��#�������
��������
• ,�������������������� ��������������� 9��� ���+�������� ���������������� ��������������
�������
��� ��#���� ����� ����� ������������ �� ����� ��� ����� @ �� #��� 9�� �� ���� �� ���������� ���
��� ��@- ������ ����-��������������������� �
1.6.5. Permisos sobre los ficheros y directorios
O�/����9�� ������������� ���������������� ��#��)������ ��������������@�����9����
����������"� 4�����5��������#������� �������������������
!� #��)��� �� ���� :#��)����@ �����������@ ������������@ ����; ����� ���� ����������� ��������� ,��
�������� ��� �� ���� �����@ 9�� ������ ���� � �� ������� :�� ���� ������@ ������� � �������;@ - ������ ��
��+��#������#��������#��)����-��������������#��)����E
• ��%���������"&���E�������������� ����������� #��)����
• ��%���������"��&���E��������������#���� ����������� #��)����
• ��%��������.�"�"�0�E�����������6������ #��)���:9����������9���������+��;�
�������������E
• ��%���������"&���E������������������ ����������� ����������: �������#��)����;@�������������
�����#���������� �:��?�@#��)@����;�� ��#��)���������9�����+�����/�A����������
��������������� � ����������������������������
�6���������-9��������+��������������/��9�A#��)����)-:��������� �������/��������������;-
9�A����������#��)���:��������� �������/����#��)���;�
• ��%���������"��&���E��������������#���� ����������� ����������E?���#��)����-� �����#��)����
:������� 9�� ���+ ������� �� �������� ��/�� �� #��)����;� 1��������� 9�� �� ����� ����#��� ��
������������ ��#��)��������9������������������������/�� ��#��)�����
• ��%��������.�"�"�0�E����������9����������/��� ���������������#�����������������@�4����
�����#��)������ ����������:�������9����������+��� ������������ ������� ��#��)����;�
�� ���� ��#������� ����� �������� ��#��)����-��������������� �@(- � : �����@ ��������- �6�������@
��������������;�D�4@�������������������@�����������-�C������@����������������D�����@�������������
������#�������� ������E
• ��%���������������������������&����E ������ �� �������� :�@(@ �;9������� � ������ ������������
��)����2 ����������������)������ ������9�� ����������������$@��9��������/ ���/��
���������������� ������������:chown;�
• ��%���������������������������%��%��������,������������&����E������ ����������:�@(@�;9��������
���������9������������ �����+����9��� ������������������ ��)����
• ��%���������������&������������E������ ����������:�@(@�;9�������� ���������9��������������
+������ �����������������
�� ������#�������������������������@�--:������W����������W@+����-�����@��������������;�
B�/�A������ ������������������������ �����(��(��(�@����� ������������������� �������-@
������9����� ��������"���������� ������������������@-��� ����������"������������+��������
�6��� �E�77�77�77@�(��7��7�@�(�777777@����
,�� �������� �� �� #��)��� ������ ��/����@ ��� � ������ chmod@ ��� ������ ���������� - ��� �
�����������@��9�������+��������������������/��� #��)����
�/��� �����@6������� �� �������� �� ��� � ���������� � ���� ��#��)��� ��� �$��� ���������9�� ��
�� �� ���� �� �� ��������E ���������� :d;@ #��)��� :- ;@ ����������� �� �������� :c;@ ����������� �� / �9��� :b;@
�� �����/� ����:l ;@��������6��� �@��(��7��7���� ������������������������@�������9��7�(��7��7���� ��
������������#��)������� �
D��������������������@�"��������E� ������������/ ����������� ����������-�� +����@������ ��
����������
1.7. Procesos en UNIX �/����9������������������������ ���������@ �9��9����������9�������� �����������������
�6����� ��$ ����� �������� :�� ����� � �� ��#������� �������;� !� ������ � ���+�� 9�� �� ����
�6�������������������,������������������#����� ��9�����������������<���� ������ ����������
�����������),�$*�
2 ���A���������������������������!���$9���6����������������������������������
������@-�����9��������������������������������� �����@��������9�� ������������
�������������
�2���������� ���� ������/� ������� ����� ���(���� ��� @�� ��+�� �
��������������� � �%��������������������������
2"�����������������9�������������6� �����������2 ������ps������� ���� ����������9��
������6��������������������������������!��A �����������+������ �9�A��������)-@������/�A���
��=@�������-���������������
���� ������������������������� ��=�����������@�������A���A �����������������������
������� ������� � � D�� ��� ��E����� ������� ��������� �� ��? ���� �� ����6� ��� �� �<����� !����
�����������? :������ki l l ;��/����������#���� �����������������:�����������=;-� �<������
��? 9��9�������������!�����������������/�����? ��������������������E
• �� � �<������ ��? �� ���������� � �������@A��� �#���< +�� ����� �� �������� ��? @-
�����A�������<���������������� �
• ��� �<��������? ��������������� �������@A���������:�����;��#�����������
��� �����@���� ���� ������� ���4�����? ����������������
��������������� � �0��������������������������
2. Intérpretes de comandos 2 � �>������� ��� ���� ��� �� �����#$ � ����� �� ���� - ��� ������� �����/�� ������� 9�� �#���<�
������� ��/�� � ������E �6����� ���+���@ ���6� #��)����� �� ���A������ �� ������� �� �� ��� 9�� ��
���+��9�������9�������/����������@-�������� �6�����2����� �������@���� �����#��@����
��/��� ��������������9���������#�� ���� ��/6�:������������6������������; �������������
�$��@ �����A��������������������/��� ���/�����*���:���$��;�
2��� ���� �A������)� �����+���� 9��� �� ���A���������������@-9�����)� �����6�����
������� ��� �������� �� ���������� �� ��"��� ��� �6��� �@ �� '�C=�� � ���� �1�%�����&�� ���&��@ ��
�9��� ���� �� ,���"@ ������*&� 1�%�����@ � ��������� �� G ����7�@ ���� ��� �6��� �� �� �)� 9�� �� ���
���A�����������������
2"����� �� ����� �� ���A������� �� ������� �� ����@�� ������ ��� �������� - ����"�� ������ �@
��9�������� ���������6�����D +�����6��� ��Esh@csh@ash@bash@ksh�
!���� �� ������ �� ��� �� � �� �� ����������@ ����� �� ���/�� �� ������@+����@ ����������
"���@����@�� ���+����)� �����#����@9����� 9������� �$����$9��� ������������� �������2���
�)� �������/������� �$���� ������chsh�D�����@������9��� �)� �������9�������+��@�����
��������)� �����#����������������������)� �� 9��������������������
2.1. bash ��*�:���� ����� ��"���;��� ������� ��� ���)� ��� ��������,���"@��� �9�������������������
�����������" �� ����������� ������������:��� ��;��������:����������������������������
���� 4��;����#��������� 4���������������������� �� ������� ��� � ���:� ���@���������
����;�=������� �������/���������������������������� ��� ��� ������������ �������� �����
+������������������ ������������ �#�����'������ ���������������������6�����@���"�����@-
����$���������@������ ��������� ��������9�������/���������������
�� #�� ��� ������������ �� �������@ /�) ������� �� )������ �� � < ���� ������� ������������
�� ���� ���������� ���/ :↑;- /6� :↓; �������� �������� ����������D�����@ �����������#��� �
������������������A��������� �������� �# ��)��$9�����:←;-�����):→;-����#������ ��"���
��� < ����@ ���" ������� ��� �$� ��� �� �/� ���� �� ���� ��� ������������� � ���/�� �� ��
��)���9��- �"��� �� � ��������� �6��� �@ ����� �� � ������ Hl s / et c/ passwdH@ ���/�������� ��
Hl s / et c/ paH-�� ��� �/� ����2�� �����9����� #�������� ���/����� �����"���������������
��9�A��)��������:���9�����"������+<���)���������4$@����9���"���������;@������������������
�� ������� ��� �/� ���@������������ ����� ������/ ����)����9�������� �4$����������@����
��/���������� ���� ���/�����: �����)������ ��� �/�+X���;�
2.1.1. Caracteres especiales
���"�����������6������������������� �$� �������4�/� ���������+��#���������� :B/ �;�
2������� �+�������� �����������@��-���+��#��������������"� ����������� �)� @����9������� �$���
#��������������A�������� 9���������������D�������6�������������:�����+����+���� ;@�
��������������� � �(��������������������������
�)� �������-� ��������������������������� ���6���������/�����#��)����9������������)�������@
������9��� ������������/������������� �����@����� ���6������#��)����- �� �$��� �
B���� ���������� ������ �� ������ ��� �$�����/�A������������� ���� �� :��� �6��� � ��9��
#����� ���� �� �� ���/�� ��#��)���;� �� � � �� �������� ��� �$�������������� ������ ��@��-������ ��
������9�������������������� �������� ���� ��:����� ��;E
• ,/����������:\ ;)��9��� �������9�����$�����������������+��+��#���������� �
• ,����� ����� ������ ��:´ ;)���9�� ���������������������������� ������+���+��#����
������ @����9������� �������� ���� ���
• ,����� ���/ ��:" ;)���9�� ������������������������� �����������+��#���������� :�+�
9�� ����� ����� ������ ��;@�"������� ���4�/� ������� 9������ ����+�������E$@` �\ �
����6��� �@����� �$�� ���/��Habc* def $ghi \ j kl mnoH������� ���+�����������/� �����E
• ��� �$��� /������������ �������������������� Eabc\ * def \ $ghi \ \ j kl \ mno�
• 2��������� ���/����������� ����� ������ ��E´ abc* def $ghi \ j kl mno´ �
• 2�������� � ���/�� ����� ���� � ��/ �� - ��� ���� �� /�� �������� �� ��� �� $ - \ E
" abc* def \ $ghi \ \ j kl mno" �
B�/�A��������@ ��� ��������@ �� � � ��+��#���� ������ �� �� �4�/� �� �� �� ���� �� ��+��#����
������ E
• ' \ ' �����������/���������
• \ \ �����������/���������
• \ ´ ��������������� ���� �
• ´ " ´ ���������������� ���/ ��
• \ ´ \ \ \ ´ �����������/������������������������ ����� ��
• ����
������������������� �� �������� �������������������-� ����,���������������� ������
�����%��������= �����3��'������D���
2 ������� ������ ������ ���� � :` ; ����� �� ��������� �� �������������6��������������9��
���������������������� ���� ���������������2�� ��+�������6��� �@pwd����� ��� ������������� I
������� ����� �������/ f d* @-�������� �$����������� ���� ����)�������l s�
$ l s ` pwd` / f d*
2 ����������� �:$;@��������������������������������9�� ���������������-����
� ���� ���/ �������#������ ���������6��� �@�/�����9����'2�������/ �9���������� ���
�� ����������"�������������@������� ����� ������������������������������� ��+�����������������E
2�� �����9��������������������+<����/������)���@��������������)��������������/�� ���� @�������� ������
������������ ������ �� �
��������������� � �*��������������������������
$ l s $HOME
2 ��� �� { } ��/�A� ���� �� ������ ��� � ���/ ��� 2���������� � ���/ �� �� �������F919G�
+������������� ��� ��� ��+�����
,�� �4�/� �� & - ; �� ��� �$� �� ����� �������� 2� �� ���� ����� : 4�� �� �������; ������
������������������������@���������� +�����������4�/� ��E
• ����� �$��� ; �6��������� ��������������������� :�������� �� �$9�����- ��+�� ��
�����);�
• ����� �$���& �6��������� ������������������������:� �������� �$9�����-� �� �����)
�� �$� ��$;�
2�� �������6��� ��� ����������� �+�� ����������� ����������"����-������������ �� ����������
3�� I��� ��+�����6��� �� ������� ����������������/ �@���� �������������$� ��/�� �������
$ l s $HOME ; l s / bi n $ l s $HOME & l s / bi n
&��� ���� �$������6����������������+����� �������6��� �@ ��+������������6����� �����
����+����� ��@-����� ��� ��������#�������������9�������������/���������������������9��
������9��� ������l s�������E
$ l s / bi n &
� 2 ��"���� ����������$� ����� � ���� ������@��� �9�����// �������A ����������9����)��������
��������������� � ����������������������������
���8����� �'��(�����
!��������2 ����� �������������������������"�* @?@[ ] -! ��� �������� �������+��#�������� 9����
�)� �
\ ���9��� �������9�����$�����������������+��+��#���������� �
´ ���9�� ���������������������������� ������+���+��#���������� �
" ,���������������������������� �����������+��#���������� @�"����������$@` �\
` ,������������������������ ����� ���������������������-���������-������ ���� ���������6��������
�������� ����������+��������
{ } ,� ���������������������/��������/ ���
( ) ,����A����������� ����������#��������������� �6�����������������
$ ,�9��������������������� ���/���������/ �@-���������-������� ���
; ��������������9�����6��������������������� ����:�������� �� �$9�����;�
& ��������������9�����6����� ��$:��#��������������;�
> 1���������� � �������������)���������
>> 1���������� � �����������?�������)����"��������
< 1���������� �������������
| ��������������9�����6����� ��$:��#��������������;@��#���9�� � ����������� �������� �$9����������������� �������������� �������� �����)�����������/��4�
�� ���2��3���%������"���"&���������"��������� ��*�
2.1.2. Los alias
,�� �� �������������9������������� �)� ��#�� ������ �������������������� ����
+�������������/ �@9�������������������/��� ��������������6��� ����������#�����������
������Hdi r H��-��9��� ������Hl sHE
al i as di r =' l s'
D���������������������������� �$�di r �+� 9�� l s����� ��� ����� �� ������ �@-9��
��������� ��� 9����� �� ��@����6��� �@���6�������������������������E
al i as di r =' l s - al '
D)������������ �$�di r ����l s@?��A��� ����������������������������@������������������
9��������#�9�����–al ���9��-�������� ��������������������� �����4@-��9����������� ���
��������/��9��� ������E
al i as l s=' l s - al '
��������������� � ����������������������������
=�������� �9�������+��������� ��������������6�������������������#����@������
9�������������9��������#��� �����$9���6��������� �������
.�� �����@������ ���6������ ����#������@������������/��al i as ������������&E
pol i f emo: ~$ al i as al i as d=' di r ' al i as di r =' / bi n/ l s $LS_OPTI ONS - - f or mat =ver t i cal ' al i as j oe=' j oe - asi s' al i as l s=' / bi n/ l s $LS_OPTI ONS' al i as v=' vdi r ' al i as vdi r =' / bi n/ l s $LS_OPTI ONS - - f or mat =l ong'
5�����������6��� ������ ������ l s������#����������������������������� ��@�����
���6�������������� +����� ��� ���������������/ �����������
D�4@ ��������������� �� ������������� �� ���������������� ��E ����������� �� ��@ ����������� ��
���/ ��@����������������������@�6������������������� �������� �������� ������6������������� �
��������9������������� �)� @-9�����������������������
��9���� �������������������� ����������@��/������������������ /����������@-9��
�� ��������������������@������������@����������������@-�������������������-������� ���� ���
2.1.3. Configuración de opciones de bash
2 ������������� �� �)� ���" ��� ���������� ������������ ����� ��� ����#���� �������
���#�+������ �� �����6��������������������� � ������set � 2��������� � �������������� �� ���
���� ��� ��� �� ���� � ���/ �� �� ������� ��#�����@ ���� )�� � ���� ��� �$� ���� �A���� ��
���#�+�������
���" ���������� �� ���6���� �� �������� 9�� ������ ��� ������ � ���������� ��� ��#���� ������
��������@���������������� ��������� ������set �����6��� �set –x���� ������HxH�,��+�@���
set +x��������� ����������� ������HxH�
,������W"@������������)��9�����"�������@�������6�������������@ ���������������
�� ��������� 9�� �� ) ���� ������� 2��� ��� �-� ����������� �� �� ��� � ������ - ��������
���������@ ����������� �� �� ���/��� �� ���/ �� ��� ��� � ���� ���������@ ����������� �� ������ -
������������ ������#��)����@����=���������������� �$� �9���� ��������6�����������������
��������@ ��� ��������������������������9�A������� +�������H��������������H�
����6��� �@�������������l s * . c@�� �����������)���������)����9������5����@�� 4��
9��������$���+� ��������������@9����� �-� ������� �� ������@ �����������#������������
� ��- ������������� �����* . c���� ���6������#��)����9������
pol i f emo: ~$ l s * . c + / bi n/ l s - - 8bi t - - col or =t t y - F - b - T 0 busqueda. c cgi . c cgi 00. c l i br er i a. c pr ueba. c busqueda. c cgi . c cgi 00. c l i br er i a. c pr ueba. c
& 2����������� ������al i as���� ������������������� ����
��������������� � � ��������������������������
�+� �����@��� ��+���������������������� ������������������/ ������� ��E
pol i f emo: ~$ echo Mi di r ect or i o es $HOME + echo Mi di r ect or i o es / home/ l l or ent e Mi di r ect or i o es / home/ l l or ent e
���������������������/�)�� –v�2�������–x����9���������6����������������������
� ������9������6�����@������#��������–x@���–v������ �$���+�������������@����9����������
� ������� �� �������/���2�������������+����� ���������������/�����������@-9���� ��������
�9���/����������/����������� ��� ���������������������6��������������:���+���)��)������
������������������;@-9�����������������)�������$�� �9���������6�����������������@9����
��������������������2���������� ���������-������������ ��4�� �&@��������� ����"@�� ��+��(��
,������W#�������)���9��/�)���� ������+���������������������������������������/���
��#��)����9������@����9���� ��������� ��������������������������� �������6��� �E
pol i f emo: ~$ set - f pol i f emo: ~$ l s * / bi n/ l s: * : No such f i l e or di r ect or y
2.1.4. Redirección de E/S y tuberías
!�����6��������������������"@�����#����@� ��������� �$������������-� ����������
��������������������9�����"@ �������@ ����� :��� -��� ��;������/�+�@�������)���9�������
������������ ��������@ ��� �6��� �@ ��9�� � ���� ��� �� ��������@ �� �+� �� �������� �� ��� @ ��
���������#��)���@�����4� ��������@���������@����2������������������""�0���������-� ���@-
��)��� ���/����������@6�������� ������@� ���6����������������������������
• ��������""�����������&�������&)�������� �$���� ������������9��:<;��+������ ���/����#��)���
�������������������������� ��#���������������
• ��������""������������������&)�������� �$���� ��������-��9��:>;��+������ ���/����#��)����
���������������������� ��#���������� ���B�������������/� �����E�����������#��)���
��� � ��������� �� � ��@ � /��� ?��� � �� �� #��)��� 9�� - �"����� 2� ���� < ���� ���
��� �$��������+����-��9��:>>;����$����������� ���/���� #��)����
• ��������""������������������������������ �$��� ����������&>:���/�A�>&;���+������� ���/����
#��)�������������������������� ��#��������� ����������
,B/ %������ +�����6��� ����������������
D ����� �������� 9�� � �� �� �� ���+�� �� ��� ��� ���� ����� �� ����� ��� �6��� �@ ��� �����
�������� ���� �� ��)������������������@����)������������� ��$9�� �� ��� ��� �� �������
)��� ��+��������������E
$ l s >t empor al
� 2 ������mor e�������)���9����#��)����������������+���@)���������������$9���� ������� �
��������������� � ����������������������������
$ mor e <t empor al
2����������������-)/��� I�������"��������������9������������������ ��������������
��<���������2���$����� �$���#��)����"� �� :t empor al ��� �6��� �;����� �$ �9�������������
&� ��4� :����;� �� ��/��4 �� ���� �� #��)��� �� � 9�� �� ������ �����/� - � ���� ��@ ���� �� ����� ��
��������������� ��� �����@����9�����������������#�����������@-��������-�����$�������
����������� �$�����/��4��� �$���� �4�/� ����-������ :| @����;�2 �6��� ��������9����4E
$ l s | mor e
�� ������ ������� ����� ������� ��� ���� ��/��4�� B���� �� ������� �� �6����� �� #���
�����������@��#���9�� � ������������ �$9��������� | ����� �$������������ ������
������������ �����)��| �
������� �'��(�����
l s >mi f i cher o ,��� ����)������ ����������- �������/���� #��)���mi f i cher o�������#��)���-�"����@� �������������������������
l s >>mi f i cher o ,��� ����)������ ����������- ��?�� #��)���mi f i cher o�������#��)������"����������
l s &>mi f i cher o ,��� ����)������ ��������������� -�����/� ������/ ������������ #��)���mi f i cher o�������#��)���-�"����@� �������������������������
l s &>/ dev/ nul l ,��� ����)������ ��������������� -������ ������/ ����������
mor e <mi f i cher o '���������� � �����������mi f i cher o)�����������������+���
l s | mor e '���������� �����#��)����)�����������������+���
�� ���5���.�%��������������""�0��
2.1.5. Variables de entorno
,����/ �������������������6���������/ ��9������������������� ����������-9�� +����
���+���@�4����� �������)� @��� �$����������/����#�������@����������������#�+������@������
���/ ���������#�������������������������@-��� ����������������������������:����������
����$���9������#������������-<��� �-���<��� �;�
����#����� � ���������/ ���� �$�������+�����:���������������+<�������;�����6��� �@
����#���� ���/ �TEMPORAL���� � ��/ t mp)�����E
$ TEMPORAL=/ t mp
����� �$� ���/ �@����������� �4�/� �N�����6��� �@ ��+������������������ �����������
���������� �������� ���/ �TEMPORALE
$ l s $TEMPORAL
��������������� � �&��������������������������
D ��#�������/ ������������ �$�������������������� ��@�������� 9���������������6��� �E
$ ESTE_DI R=` pwd` $ l s ${ ESTE_DI R} / * . c
2������6��� ���)���� �$�� � ���:{ } ;���� ������ ���/���� ���/ ������)�/�����������
:l s $ESTE_DI R/ * . c;@� �)� ����4�����9��� ���/���� ���/ ���� �-�@ �����@� /��������������:/ ;@
-��������� � ���� ���������4� ��������
�� ��������� ��� �$� � � �� �� �� ���/ � �� ��#����@ �/������������� ���� ��� �� ���� ��4
:�����������;�
�� ��� �$� � �4�/� � $ �� �� ������ ��� 9�� ������ �� ���/ �@ ��/���� ������� � ����� ���� �
���� ��:´ ;�����������/��������:\ ;�
,����/ ����#����������)� ��� �� ������)� ���)���9�� �����+��� �$���������)�
����$��� � ����������/ ����������������������@���� ������expor t :- ������������;�
2"����� +��� ���/ �� �����#����� �� ��� ��- ���<�@ 9�� ����� ��# �6�� �� B/ 0� , ���
���������������� ��� ���/ �PATH@9�� ���������6������������/<�9����� �� �$��������
:���"�����H�I����;�D�4@�����������������/�� ������� ����������@�������9����������A��� ���
����� ������� ���/ �PATH�PATH ���������6����������������������������:: ;�
������� �'��(�����
PATH 1�����/<�9�������������
HOME 1�� ����������"����
PS1 ,������������ �
PS1 ,���������������
SHELL !�������� �$�������)� �
LOGNAME ���/����� �$����� ���� :���/����������;�
HOSTNAME ���/������ ����� ��9�������
�� ���6��7���� ���������&�����%)���%���&��&���
�������?������������ ��)��� �$���� � ���� ���/ ������6��� �@��?���� ����������
/ t mp ��)E
$ PATH=${ PATH} : / t mp
�������/ ��������������� �9����#����� ����������)���/����9��� �������������9���
�)� �������9��9������ ����������/���������@-9����� �������4�/� �:����$;�2��� ����"����������
�������2 ������� ��� 9��������������������� +�����������@ �6����� ������������#����������
��� ��@-��������������������������������@��������@����
2 ������������� ���������� ������ ����/ �����@���@����@���������� ������� �2�����
���/ �� �� ���� ���� �� �������� 9�� �� ������ ���� ������@ ��9�� �"����� +��������+��9��
������#�������� ������ �� :���� ��#������������ ������ ��;� ,B/ ( ����+� +���� �� ������+�����
��������������� � ����������������������������
)/��� ����� �$����� ����/ �����������B����������$����� �4�/� �T@��� �9�� ��#���� ���/ �
)/��9����� �$���/ �/����������� � ����������� ��2 ��+�������6��� ��������-����������������
#��������� ���/���� ��9���@��+���������������@� ��������������/6�-���4�/� �$�#E
PS1=\ \ h: \ \ w\ \ $
� �'�� �'��(�����
\ h ���/���� ���������,���"�
\ w 1�� ���������������#�����
\ t ,)����� ��#�������E''E���
\ d ,#��)��� ��#�����H$������ ������$D�H:����6��� �HB��'-��H;�
\ u 2 ���/���� �������
\ $ 2 �4�/� �$���������������� �#����� ������������
�� ���8��10�������������������� �������%�&�
��������������� � �%��������������������������
3. Comandos 2������������������������ ������ ��������� ������������������������@+������� ��
�� ���+����������+��4�E
• '��6���#��)�����
• ��������������#��)�����
• '��6����������-�������������
• '��6������������
• '��6������/ ���
• D�������������� �������
• ������
�� �� ������ 9�� ����������@ )����� �� ����������� �� #����� �� � �������� �� ������@
��� �$��� ��������������� B/ �*E
� �'�� �'��(�����
R���������S 2 ������������������������������������ ���
Y�������Z�������[ =�/�������#����� +���� ���������������������� � ���:�������;�
par amet r o. . . ,�������������������������9��� ������������������ ���������������
�� ����9��1�����"��������������"�� ���������&������������"�%������
������������������/�������#������������ 4������������������ ����#�����- - hel p
:�� ���,���";-�������� ������man:���� 9��������;�
3.1. Comandos de manejo de ficheros 2� ��� ���+��4 ��������� �� ������� �� ������� ��� � ���6� �� #��)���� :����� ���� �� ��
���/�����#��)���@�����������������;�
3.1.1. Comando ls
l s ��+��#�� ����� �����������'� ����� �� ������ �� ���/��� �� �� #��)���� - ����������� 9�� )- �� ��
�����������,����"����E
SI NTAXI S l s [ modi f i cador es] [ f i cher os. . . ]
,������#���������������������#�����������#������-���������,��#��)������� �������������
��#��)����9��)-9�� �������������� �����@�� ����������� ��#��)�����D�4@� ������������������
�������� ����������� ������ ��#��)������ ������������� @�������� #/A������������� ����:��
���/ /6� - ��+� �� �$9����� �����)I �-<��� � - ���<��� � �� ������ ��� ������@ ������� �
�-<��� �;E
��������������� � �0��������������������������
pol i f emo: / boot $ l s Syst em. map any_d. b chai n. b os2_d. b any_b. b boot . b conf i g
����4���)/����������������@�� ������ � +������ ��#��)����E
pol i f emo: / boot $ l s * . b any_b. b any_d. b boot . b chai n. b os2_d. b
���/�A��� �����������E
pol i f emo: / boot $ l s a* . b b* any_b. b any_d. b boot . b
2������ ��������������������� ����)�����,����)����9��������$�����������:. ;�����������
��)����H������ ��H@-���� �������� �����@�����9��������#�9����� ����������2��� �)���������
����#�����- aE
pol i f emo: / boot $ l s - a . / Syst em. map any_d. b chai n. b os2_d. b . . / any_b. b boot . b conf i g
�/������� 9�� �� ���/��� �� ����������� �� ������+��� �� �� ���/��� �� #��)���� ��� 9�� ������
��+����� �� ��/�� ��� ��� :/ ;� =���������� �� ������� �� ,���"- � ���� �������� 9�� ��� ������ ��
����/ �9����#��)�������������� ��������$������� ����#�������2����� �� ����� +������������
#��)��� :����@ ��������@ ����;�!�� l s@ ����� �� ���/�� �� ��#��)����@ ��������/����� ��#������� ��/�� ��
������@���� ����#�����- l E
pol i f emo: / boot $ l s - l t ot al 157 - r w- r - - r - - 1 r oot r oot 143835 Jun 24 1997 Syst em. map - r w- r - - r - - 1 r oot r oot 204 May 25 1996 any_b. b - r w- r - - r - - 1 r oot r oot 204 May 25 1996 any_d. b - r w- r - - r - - 1 r oot r oot 4416 May 25 1996 boot . b - r w- r - - r - - 1 r oot r oot 88 May 25 1996 chai n. b - r w- r - - r - - 1 r oot r oot 5147 Jun 24 1997 conf i g - r w- r - - r - - 1 r oot r oot 192 May 25 1996 os2_d. b
,��#�������9��������� ��� ������ ��+������:���$9����������);E��������:-����;@�<����
�� �� ��� 9�� �"����� ��/�� � #��)���@ � ����������@ � +���� �� #��)���@ � ��?� �� /-���@ #��) ��
����#������-� ���/���D�����@ ����������� ����������� �<������� ��/ �9����������:���8� �/-��
���� �����@��9����/�A������������&��/-���;9������� ��#��)���� �������
2 ����+����� �������������� �$� �������@-9������-)/��� ��� �$������� �������������
���������� ���9���������������@����$�� ����+����� ����@���������� �$�������+�����������
��������������� � �(��������������������������
������������ ������ ��#��)���� �������2��� �)��������� ����#�����- F:���������� �$���������
�����#����@��9���� ������#�9�����;E
pol i f emo: / l i b$ l s - F cpp@ l i bcur ses. so. 1@ l i bm. so. 5@ l d- l i nux. so@ l i bcur ses. so. 1. 0. 0* l i bm. so. 5. 0. 9* l d- l i nux. so. 1@ l i bdl . so@ l i bncur ses. so@ l d- l i nux. so. 1. 9. 5* l i bdl . so. 1@ l i bncur ses. so. 1. 9. 9e@ l d. so* l i bdl . so. 1. 9. 5* l i bncur ses. so. 3. 0@ l i bc. so. 4@ l i be2p. so. 2@ l i bncur ses. so. 3. 0. 0* l i bc. so. 4. 7. 6* l i be2p. so. 2. 3* l i bss. so. 2@ l i bc. so. 5@ l i bext 2f s. so. 2@ l i bss. so. 2. 0* l i bc. so. 5. 4. 33* l i bext 2f s. so. 2. 3* l i bt er mcap. so. 2@ l i bcom_er r . so. 2@ l i bgdbm. so. 1@ l i bt er mcap. so. 2. 0. 8* l i bcom_er r . so. 2. 0* l i bgdbm. so. 1. 7. 3* l i buui d. so. 1@ l i bcur ses. so. 0@ l i bm. so. 4@ l i buui d. so. 1. 1* l i bcur ses. so. 0. 1. 2* l i bm. so. 4. 6. 27* modul es/
2 ����+���?�� ���/���� #��)���E* �������#��)����6����/ �@ / �����������������@ @ �������
�� �����/� ���%@ ����!���������������)������� @����?�����
,B/ �������� ��������� ������#��������� ������l s�
9��(������ :��&����
- 1 ,��� ��#��)��������<����� ���:��#��)������ 4��;�
- l .����� �+�E��������#��������� ��#��)����:��������@����������@#��)@����;
- R 1��������E��������������@��������/�A��������������#������������
- a B���� ��#��)����E��� �-� ��#��)����9��������$�����������:. ;�
- A !������� ��#��)����E��� �-� ��#��)����9��������$�����������:. ;@�"����� �������������H�H-H. . H�
- B ������&���E�������� ��#��)���������&��/:��������+�����;@9�� � ��#��)����9�����������H~H�
- d ,���� ���/������������������ �+���������������
- t ����� ��#��)���� ��������� #��)-)��������#�������
- S ����� ��#��)���� �������������?��
- X ����� ��#��)���� ������������"��������
- r ����� ��#��)������#����������
- U ������� ��#��)���������+��#���I �� ������ �������9����������� ������
- s '������ ��?�������)��� �$9������������/��@��������/ �9����
- F '�������������� #�� �� ���/��@9�������� ������#��)���:����� ����+����� ����;�
- i '������ �����: $���������;��9�����/�� ��#��������� #��)����
�� �����������'�"���������������"�%�����l s�
% 2���������� ���� ������/� ������� ����� ���(���� ��� @�� ��+�� �
0'��)�� ��������������9������� �����������������@������ �������������@+���� ������������� ��)���@����
��������/��@�����/����H~H�
��������������� � *��������������������������
2"��������������������������� l s9�� ���� ��#��)������� +������������������������Edi r @
vdi r @����
3.1.2. Comando pdw
pdw :��� �� (��&� �� ��������'; ������ ��� ���� �� �� ���������� ��� � �� ����� ����#������� ��
����������
pol i f emo: ~$ pwd / home/ l l or ent e
3.1.3. Comando cd
cd :�"� ��� ��������'; ����� �� ��/�� � ���������� ��� ��#����@ ����������� ���+� ��� � ��/� ��
������������D������������������ ���/���� ���������� 9��9���������/��E
SI NTAXI S cd [ dest i no]
!������������������������/����������#��������/�� ����� ��� ������������� ������������
��������@cd��/� ����������"����2�� ��+�������6��� ��/�������������/����������������@������
� ���� ��� �� � ������ - ������� pwd� �/������� ��/�A� 9�� � ���������� �� ������ :�� ���� ���
/ home/ l l or ent e;�������������/�A����� �4�/� �H~HE
pol i f emo: ~$ cd / usr / i ncl ude pol i f emo: / usr / i ncl ude$ pwd / usr / i ncl ude pol i f emo: / usr / i ncl ude$ cd . . pol i f emo: / usr $ cd . pol i f emo: / usr $ cd / pol i f emo: / $ cd / home pol i f emo: / home$ cd l l or ent e pol i f emo: ~$ pwd / home/ l l or ent e pol i f emo: ~$ cd / t mp pol i f emo: / t mp$ cd pol i f emo: ~$ cd / bi n pol i f emo: / bi n$ cd ~ pol i f emo: ~$
�01-2�
����/����� ���� �������������� ������:cd;-� ���������,�����������'�C=����� ����� �$�������Hcd. . H��������� �������� �����������@ ��� ������������'�C=��:�������������� �;@�������������
3.1.4. Comando mkdir
2 ������mkdi r :��&����������'; ����� ������ ������ ��/�����������@ ���� �+� ��������� ��
��/� ������������������������������������������� ���������@������#������� ���I ���������������
��������� ������������ ����
��������������� � ���������������������������
SI NTAXI S mkdi r [ opci ones] di r ect or i os. . .
,�� ������ ����������� �� ������ ������#��� ������� �� ��� /�� �� � �� ��� ���������� ��� �
�� ���������������������� ���������������� �� ��$�����6��� �@ �����"����� ���������� / t mp/ 1@��
�����������/ t mp/ 1/ 2�D������/��������/ t mp/ 1@�/������ �$� ������- p�
pol i f emo: ~$ mkdi r / t mp/ 1/ 2 mkdi r : cannot make di r ect or y ` / t mp/ 1/ 2' : No such f i l e or di r ect or y pol i f emo: ~$ mkdi r / t mp/ 1 / t mp/ 1/ 2 pol i f emo: ~$ mkdi r - p / t mp/ 1b/ 2b/ 3b
,B/ �������� ��������� ������#��������� ������mkdi r �
9��(������ :��&����
- p !���������������E����������������������@��������������������:�����"����;�
- m �������������#��� ������������ ����������������
�� ����$������'�"���������������"�%�����mkdi r
3.1.5. Comando rmdir
2 ������ r mdi r :���� �� ��������'; ����� �� /���� ��/����������� ��4��� ������� /���� �����
����������� �� ���� �����@ ������#����� �� ���� �� �� ���������� �� ���� ��4�@ �� ����� ��� /������ ��
����������������4������<���������������� �������H. H-H. . H@9������������/�����
SI NTAXI S r mdi r [ opci ones] di r ect or i os. . .
������� ��� �$� � �������� C� ��)���/������ ����������@ �������9�� ��� ������ ��������+
�����#��)���������6��� �@��)�����r mdi r - p / t mp/ 1/ 2/ 3@����������� �����/ t mp/ 1/ 2/ 3I����������4��
���������/����@��������I����@ ��+��������/����/ t mp/ 1/ 2@ ��+�/ t mp/ 1@-#�� �����/ t mp�
,B/ � ������ ��������� ������#��������� ������r mdi r �
9��(������ :��&����
- p >����������������E�����A���/����������������@�������/����� ���������������
�� ����(������'�"���������������"�%�����r mdi r
3.1.6. Comando cp
2 ������cp:���';������������#��)�����D��������������������#�����-���������@��#���
9��� ��)���������#��������#������������� �������������
��������������� � ���������������������������
SI NTAXI S cp [ opci ones] or i gen. . . dest i no
�� ����������������� �-������/������)���:�� �������/����������������;@� ���/���� #��)���
�������������� �����9����� ���+���������� ��@�� ��������+�������������� ����������
������@� ��������� ���������� ���/�����������������B���� ����)���������+����������� ����������
����������
26��� ��E
pol i f emo: ~$ cp f i cher o1 f i cher o2 pol i f emo: ~$ cp f i cher o1 / t mp/ f i cher o2 pol i f emo: ~$ cp * . c / t mp pol i f emo: ~$ cp f i cher o1 f i cher o2 / t mp
,����)��������A�������������� #��)��� -��������������� ������9���� �$ ����@�����
9����� ������� ����#�����- p���������/ ����������:����#�������;�� ������cp����������� B/ ���
9��(������ :��&����
- i ����������E���+�����������/������/����#��)����"��������
- l 2���$�������@����� ����
- s 2���$�������@���� ����������=������
- b !������������+������� ����)����9����/������/��
- P !���� ��)��������+����� ���������������������� �-���� ������� �������+���
- p '������ #��)@��������@����������-+������ ����)�������+���
- R 1��������E������/�A� ��#��)����9�����A���������������������
- u D��� �$�E����/������/�#��)���������9��� ���+��������������9��� ��������
- v '������ ���/������#��)�������������� ��
�� ����-������'�"���������������"�%�����cp
3.1.7. Comando rm
2 ������r m:���� �;�������/����#��)�����D������������������� ������������������
���/�������
SI NTAXI S r m [ opci ones] f i cher os. . .
!��������������������������������/�� ����)����9������/����@r m������������#����������
9������������� ���#����������������� �$�� ����#�����- f ����� ��������@��9����������#���������
��#��)���:��9�����+��������������������;��� �$���- i �
D +�����6��� ���������r mE
��������������� � ��������������������������
pol i f emo: ~$ r m . c * . h pol i f emo: ~$ r m - f / t mp/ *
�������/������������������� ������� �������������������- R�2 ��+������������� ���������
�����������������������:- ����/�����������; ������#�������E r m - f R * �=�/������������)���������
��� �$�����������@������9���������������������������
�01-��9+0:1-�1�2�
����/�������#����� r m��� � �������� �����/�� :mv;�'��)�����������'�C=�� �����/�� �������������� ����� ��������� ��
�����/��@-9������ �������� ��������'�C=��r ename�;��.��!����������������&��������������������������
,B/ �&����+� �������� ������������r m��
9��(������ :��&����
- i ����������E�������#�������������/������#��)����
- f ���������#�������������������������#��)������"�����
- r 1��������E/���� ��#��)������������ ����/�����������-� ������/�A� ����/�����������
- R �+� 9��- r �
- v '������ ���/������#��)���������/���� ��
�� ����/������'�"���������������"�%�����r m
3.1.8. Comando mv
2 ������mv:�� �;���������/��� ���/����#��)����������������@�������� ���������� ��/�
��������������=�/����������#��������������)���������+��-������������������� �)-�����+��@�
������������ ��� �� ���/����#��)���W��� �� ������������������W-mv �����/���-3�������� ��)���I��
��/��@��)-���������������+��@�� ���+���������� +�������@� ��������� ���������������������@
-mv�� ���<�������� ����)���� ���������������������
SI NTAXI S mv [ opci ones] or i gen. . . dest i no
,���������9���������������������������� B/ ����������6���� �9������� �$����
������cp�
9��(������ :��&����
- i ����������E���+�����������/������/����#��)����"���������� ��������������������
- b !������������+������� ����)����9����/������/��
- u D��� �$�E�������#��)���������9��� ���+��������������9��� ��������
- v '������ ���/������#��)�������������� ��
�� ����2������'�"���������������"�%�����mv
D���������������� ����+��������6��� �������������������E
��������������� � ���������������������������
• 1����/��� #��)���copi a1copi a2�
• '����-�����/��� #��)���copi a1copi a2��� ���������������
• '���������#��)���� ���������������� �
• '���������#��)������ ���������������� ������������� �
pol i f emo: ~$ mv copi a1 copi a2 pol i f emo: ~$ mv copi a1 . . / copi a2 pol i f emo: ~$ mv * . t i f f / t mp pol i f emo: ~$ mv / t mp/ * . t i f f .
3.1.9. Comando ln
2 ������l n:�� &;������������� ������������������������ �������������/����������
�����#��)���������������2��� ������������������ ��#��)����9�����������������@��������#������
����#��)����,���� ����������������������E
• ��&���������:"���;E �����������������:� ���/���� �� ��;��#������ $���� ������� 9��
����������� �������� ��)����� $���2���$���� �����@������� �������� �����
�<�������� ���9������������)����2 #��)������+�� ����/�A����� ���D�4@ /�������� ��
:��9����� �� #��)������+�� ;��9��� ������� ����������:� ���/���� �� ��;@���� ������
���������� �� �� � ����� �� ������ 2� �� �+� �� ��������� � �<���� �� �� ��� ��������-@ �� ��
9��������� ���@���������������� ����� ����������� #��)����!���$9����?������ ��
�����#��)���@������������ �<�������� ����
• ��&��������! &����E ����� �� ���������� :� ���/�� �� �� ��; ��#��)��������9���������� ����
:�����������������;@-���������������������"��9����#������ #��)������+�� �2 #��)���
���+�� �� #������ ���� ���� �� �� ���/� ���� �� /������ � �����/���� � ������� � #��)���
���+�� @ ���� ������/� ����9��������������������@����������/6���9��-���"�����:�������
������������������G ����7�;�
2 ������l n����������������� �����/����� #��)������+�� -�� �� ��E
SI NTAXI S l n [ opci ones] or i gen. . . [ dest i no]
!������+��������#��������������#��)����������������@���������!����������������#������
���/���� �� ��:��� ���+������<������)��������������;@�/������������������������� ���� ���������
:�� ���� ��� � ���+�� ��� ����� ��)���� � �����������@ � �� �����@ - �� �� ��� �� ���� ��� �� ������
���/���9��� ���+��@��� �������������������;������������ �������@��������9����� ������������� @��� �
9��� ���+����/���������������������������#�������� ��� �
2 ������� ����#�����9������������ �$���- s@9���������9����������� ������/� ������ �+���
�� ���������
��� ��#����@ l n �� ��/������/� �� ���/��� �� #��)���� 9�� �"���� �� ����@ �� �� �+�@ �� ����
������������� �$� ������- f ��9������������D�����@��� ������- i ������+�������������/������/��
+<�#��)����"��������
��������������� � &��������������������������
2������������� ���� �� �� ������� �� ����������� �� ��� ����� ����������� :� ������ �4 �����
)��� �;� �� ����������� �� � �������)��� �� ��� ���/� ����� 2���� �� ��� ����������� �� ���6� �������
������#���� �� ����������������@�"��������9����� ����� ������/������� �$� r mdi r @ ���� r m@-9��
�� ������������������������������������� ��#��)�����
�� ������#��� �� �� ��� ���/� ���� ������� ��� �$� :����� ���� ���)� ����; � ������ l s ���
������- l @-9��6������� ������������ ��#��)���������� �������9��������#��� ������#��)���@9�����
����� ���� �����Hl H�����6��� �E�����+���9�����������������"��������������E� ����������Hdi r 1H-
�� �� �� ���/� ��� A���@ ��� Hot r o_di r 1HI )��� l s - l �/������� 9�� di r 1 �� �� ���� ����������@ -
ot r o_di r 1������ ��9������@�����������@di r 1:���� ������6���� ���/��@ �����)�� 4��;E
pol i f emo: ~$ mkdi r di r 1 pol i f emo: ~$ l n - s di r 1 ot r o_di r 1 pol i f emo: ~$ l s - l t ot al 1 dr wxr - xr - x 2 l l or ent e user s 1024 Oct 15 09: 59 di r 1/ l r wxr wxr wx 1 l l or ent e user s 4 Oct 15 09: 59 ot r o_di r 1 - > di r 1/
,���� ������������������������#���@-9������� ������� ���������9��������+�� ��@-��)-
������������+��� ����A����:�����A����������� ���#�����;�,�9���4�������������+����������� ���
�������/�� ����$���������:��������� ����������#��)���;�B�/�A� ��������)������l s - l @-
9�� ��+��� �� ��� ����� � �<���� �� �� ��� 9�� �� ������� �� �� #��)���� 2� � ��+������ �6��� �
��� �$�����/�A� ������C��9��������������/�A� �������������H. H-H. . HE
pol i f emo: ~$ l s - al t ot al 7 dr wx- - x- - x 3 l l or ent e user s 1024 Oct 15 10: 08 . / dr wxr - xr - x 16 r oot r oot 5120 Oct 14 11: 27 . . / dr wxr - xr - x 2 l l or ent e user s 1024 Oct 15 10: 01 di r 1/ l r wxr wxr wx 1 l l or ent e user s 4 Oct 15 09: 59 ot r o_di r 1 - > di r 1/
�/�������9��E
• 2 �� ��ot r o_di r 1�� ��������� ��@-9����������� $���A �
• 2 ����������di r 1���������� ���E� ��-�������@-� ����������Hdi r 1/ . H@9�������� ������di r 1
����� ��� � ������ ����� �� ���� :���� ��� mkdi r ; � ���������� di r 1 :\�� �� ������ �� �� ���
���/� ����];�
• 2 ���������� H. H ����� �� ���E � ������ H. H@ � �� H/ home/ l l or ent eH - � ��
H/ home/ l l or ent e/ di r 1/ . . H�
• 2 ����������H. . H������< ��� ���� ���E� ������H. . H:��������� ����H/ home/ l l or ent e/ . . H;@� ��
H/ homeH @ � �� H/ home/ . H-� ������������ H. . H�������� �����������home �������������� :��
#���H/ home/ USUARI O/ . . H;�
,�� ��������� �� ��� ����� �� ����� ��)��� �������� ��+������ ��#������� :���� �� �� ����
������������#��)���@����?�@����;E
• 2 ��������)����
• 2 �����������
��������������� � ���������������������������
• 2 +�����
• ,�����������
• ,#��)������#������@�����@����
,B/ �%������ �������� ����������9�������� ������l n�'��)���� ��������6���� �
��� �$�����������������
9��(������ :��&����
- s �����9�� ���� ���9������/��������������/� ����:-�������;
- f �����9������/������/� ��#��)�����"����������� ��������������������
- i ����������E���+�����������/������/����#��)����"���������� ��������������������
- b !������������+������� ����)����9����/������/��
- v '������ ���/������#��)��������������� ���
�� ����5������'�"���������������"�%�����l n
D +�����6��� ���������l nE
• !������� �����/� ���������� ����������������������'������/���������� ���t t ys�
• !������� �� ������������������������ ���acceso_a_di sposi t i vos�
• �������� ��������� ��#��)����9�����+� �������C������ �� ������������pr act i cas �������
����������pr act i ca_copi ada@��/������/����� ��#��)����9��������)/����A��������������
• �������� ���� #��)���/ home/ pr of esor / not as_pr act i cas #��)���mi _susupenso�
pol i f emo: ~$ l n - s / dev/ t t y* t t ys pol i f emo: ~$ l n - s / dev/ t t y acceso_a_di sposi t i vos pol i f emo: ~$ l n - f / home/ f j gar ci a/ pr act i ca/ * ~/ pr act i ca_copi ada pol i f emo: ~$ l n / home/ pr of esor / not as_pr act i cas mi _suspenso
=�/���� ������ ������ ������� ����� �������-��� �� ��� ���/� ���� ����� �/6���� �/����� ��
����������� ��#������� ��� �$��� ���� �� ����@ - 9�� � �� �� /����� � �/6��� ���+�� ��+������ ���
������#��� �� � ������� �� �������@ ���� ������������� ���� �� ��� �/������ ��� �� �� ���
5�����������/ ��������6��� ��
�����+���9�����������������������Edi r 1-di r 2�=�������di r 1@�������� #��)���mi _f i cher o@-
)��9��������������� �����/� ��� #��)���@������ ����������di r 2E
Cr eaci ón de l a est r uct ur a pol i f emo: ~$ mkdi r di r 1 pol i f emo: ~$ mkdi r di r 2 pol i f emo: ~$ cat >di r 1/ mi _f i cher o Est e es el cont eni do de mi _f i cher o ^D
2 ��+�������������������� �� ���������������D������9��l n������� ��: )���l s - l �����
� �� ����� ��������� ���� �;@������������� ����������� #��)������+�� E
��������������� � %��������������������������
pol i f emo: ~$ l n - s di r 1/ mi _f i cher o di r 2 pol i f emo: ~$ cd di r 2 pol i f emo: ~/ di r 2$ l s - l t ot al 0 l r wxr wxr wx 1 l l or ent e user s 15 Jan 25 11: 14 mi _f i cher o - > di r 1/ mi _f i cher o pol i f emo: ~/ di r 2$ cat mi _f i cher o cat : mi _f i cher o: No such f i l e or di r ect or y
,�$����9��������������@��9��� �� ��/���� ��)������+�� ����Hdi r 1/ mi _f i cher oH�������
�/��������� :~/ di r 2/ ;@�������@9�����������9��� ���+�� ��H~/ di r 2/ di r 1/ mi _f i cher oH�=�������� ���
�� �������� � ���+�� :��� �$��� �� ��� �� ��� ����� � ���������� ����� �� �/�� � �� ��; �� ��
H. . / di r 1/ mi _f i cher oH�,��+������ ���9����/��4���)/����� ��� ����� �� ��@������9��@���
� ������������� 9�������������/������ �������������� �� ��@���< ��������������� ���+�� : �
9����������9���4�������������� �/������#�� �� �� ��;�2������������@ #�����������������
�� ���� ��+������E
pol i f emo: ~$ l n - s . . / di r 1/ mi _f i cher o di r 2 pol i f emo: ~$ cd di r 2 pol i f emo: ~/ di r 2$ l s - l t ot al 0 l r wxr wxr wx 1 l l or ent e user s 18 Jan 25 11: 24 mi _f i cher o - > . . / di r 1/ mi _f i cher o pol i f emo: ~/ di r 2$ cat mi _f i cher o Est e es el cont eni do de mi _f i cher o pol i f emo: ~/ di r 2$
1���������9�� ���� ���/ �� �� � �� � ����������/6������ �� ��� ���/� ����I�� �� �� ���
����� ������� ��9����/����������#����� 9�������������� ��������� ��������
,����� �� �����/� ���)�������������������#�� ��/�����/������� �� �����+���������
� �6��� �@����/����� �� ��mi _f i cher o����/������:����6��� �������������di r 3��������di r 2;@�
�� ����6���������������E
pol i f emo: ~/ di r 2$ mkdi r di r 3 pol i f emo: ~/ di r 2$ mv mi _f i cher o di r 3/ pol i f emo: ~/ di r 2$ cd di r 3/ pol i f emo: ~/ di r 2/ di r 3$ l s - l t ot al 0 l r wxr wxr wx 1 l l or ent e user s 18 Jan 25 11: 24 mi _f i cher o - > . . / di r 1/ mi _f i cher o pol i f emo: ~/ di r 2/ di r 3$ cat mi _f i cher o cat : mi _f i cher o: No such f i l e or di r ect or y
2��� 9�������@�����������/ �����/ ���@����6����� �$�����/�� ��������6��� �E
pol i f emo: ~$ l n - s ~/ di r 1/ mi _f i cher o di r 2 pol i f emo: ~$ cd di r 2 pol i f emo: ~/ di r 2$ l s - l t ot al 0 l r wxr wxr wx 1 l l or ent e user s 29 Jan 25 11: 45 mi _f i cher o - > / home/ l l or ent e/ di r 1/ mi _f i cher o pol i f emo: ~/ di r 2$ cat mi _f i cher o Est e es el cont eni do de mi _f i cher o
��������������� � 0��������������������������
3.1.10. Comando chmod
2 ������chmod:�"� �������;���������/�� ��������������#��)����������������������������
������������ �����������&�,���������������������"�����'�������������:��+���&;�chmod�����������������@
������� ����������������@- ��+� ����)����:��#��)���@���������� ���; ��9��)-9��� ��� ��
��������E
SI NTAXI S chmod [ opci ones] per mi sos f i cher os. . .
,���������� �������� ������#��������#����E ���/� ������A���������2���&�"�0����% 0��"�@ ��
����������������#������ ��+����������"��E
[ { u| g| o| a} ] { +| - | =} { r | w| x| s}
2���������E�������� ������ ���6����Y�8��8��8��[@���4�/� ���YJ8�K8�L[@-�� �����Y�8�(8��8��[�
• ,������ ���������#�� ������������/��E����������:�;@+����:�;@������������:�;@�/��������
����������:�;�����������������@����������
• 2 �4�/� �������#����������/���� ����������E?������������:J;@�������+�����������:K;@�
/������/ �������������<����:L;�
• , < ��� ��� ������#�� � ������� ��+���E �� ����� :�;@ �������� :(;@ �� �6������� :�;@ � ��
���/ ��������������������� :�;��� ������� ����< ���� :�;@ ������ ��� �� ������ ������#���
������:�;� +����:�;�
����6��� �E
• D?������������ ���������� ���������Ea+r �
• 1������+������������������� ���������9��������� +����Eo- w�
• 2��/ ������������r x: �����-�6�������; ����������E�=r x�
• D?��������������������� ����������-� +����Eug+w�
• D?�����������������#������������������-+����Eug+s�
���������� �������� ��� ��$�������� ������������������.�������"������&���"����"��������
�6��� �@ �� ���/ ���� �������� �� �����- �6������� ����������- �6������� ����� ��� �$��� ��+������
� ��Ea=x, u+r �
2���&�"�0����%:��"�@ ������������������#�������������<������� ��)�����#��@�������
��#� :�<���� ����� * - %; ��������� �� �������� �� ���/ ��������� �� ����������@ ����������@ +���� - �����@
��������������@ �� #��� � � �� *C% ����� �� �������� ��+<� � �� �� B/ �0� 2� � ��� ��
���/ ���������������������@ �� ��������������@������ �������������
��������������� � (��������������������������
�4����� <�&���!������� +�������
0 000 - - -
1 001 - - x
2 010 - w-
3 011 - wx
4 100 r - -
5 101 r - x
6 110 r w-
7 111 r wx
�� ����6��1��������%:��"���������������%���������""����
����������#�������������#��@��������9�� �����������*@�������9���%����9��� ����*�%��
,�� �������� �� ���/ ��������� �� ���������� �� ��� �� ��� �$���@ ��� � 9�� ���� ����� �� ��� �� �� �
�4+����@ �� �� �������� �� ����� ��#�������@ 9�� ��� �� ������<������ ��� �$���� 5���� +����
�6��� ��E
• ����+������ ����������E777�
• ��������� ����������@-�� �����@�6�������-�������� ����������E744�
• ��������� �����-�6������������E555�
• ��������� �����-�������� ������@���6�������- ����� +����-���6������� �����E651�
,������#�������9�������� ������chmod����������� B/ �(�
9��(������ :��&����
- v '������ ��/��9���� �$�� ������������#��)������������
- c '������ ��/��9���� �$�� ������������#��)������������� ����� �$ +<���/���
- f ����������������������������/ ���/�� �����������
- R 1��������E��������/�A� ��#��)����9�����A�����������/������������
�� ����8������'�"���������������"�%�����chmod
3.1.11. Comando chown
2 ������ chwon :�"� ��� �( ��; ����� �� ��/�� � ���������� �� �� #��)���� ���+�� ����� �
���������� �� �� #��)��� �� �� ������� chwon ��/�A� ������� ��/�� � +���� 9�� ��������� � #��)��� :�
������chgr p�������/�A�����/��� +����@������ ������������;�
SI NTAXI S chown [ opci ones] [ pr opi et ar i o] [ { . | : } gr upo] f i cher os. . .
2 ���������������-+������������#��������������/��������������#���� ����������@� +�����
�������� ��$�2 ���/���� ����������-� +�������������������������:. ;����������:: ;@���
��������������� � �*��������������������������
������������� ������� �9���������/��� +����@��/���������� ������ ����������������� ���/��
�� +�����
,B/ �*�������� �������� ������������ �������5����)�� +�����6��� ���������chown�
chown l l or ent e / t mp/ * . c / t mp/ * . h chown l l or ent e: user s / t mp/ * . c chown : user s / t mp/ i ni ci o. c chown r oot . r oot / t mp/ i ni ci o. c
9��(������ :��&����
- R 1��������E��/�� ����������3+���� ��#��)������ ����/������������
- v '������ ���/���� ��#��)����9���������
- c '������ ���/���� ��#��)����9��������@�� ���)�� +<���/���
- f ������������6����������������������/��� ����������3+�����
�� ���$9������'�"���������������"�%�����chown
3.2. Comandos de procesamiento de ficheros 2������"������+���<�����������������?������ ��������������#��)��������"��@������
9������ ������/������� ��������������+����� 9���� ���� ����,���������9���������������
���� ����� ��� �$� ���� ����� #��)���� �� ��"��@ ��9�� ��� �� 9����� ����� 9�� �� �� ����� ��� �$� ���
#��)����/�������
3.2.1. Comando cat
2 ������cat :�� ���� ���;�������������������#��)�����2 ���� ����������������� :���
� �� �������;�D����������������� ��� ��#��)����9��)-9�� �������� 2���� �� ������� � ��
������� �� � ���������� ��9�� ������ �� ���� �� �� � �� ������#�� ��#��)���@ � ���� ��� ����9�� ��
������������� ���#��)���:���������� ���������)/��� ����cat ;�������������#�����+<�#��)���@
cat ������ ����������� ������������:��� ��;�
SI NTAXI S cat [ opci ones] [ f i cher os. . . ]
cat ����� �$������������������9��?��#��)��������"���2 ������Hcat >nuevo_t ext oH����
#��)���nuevo_t ext o���� ����������� �9������������������/����,�9��)�������� ������������
:��� �� �� ���� ���; - � �� � �� �������@ 9�� �� ���� ��� ���� ������������ )�� � #��)���
nuevo_t ext o�!������� �$���� ��� ������������ �������������@�� ������� #�� �� ��"��
9�������/�����������9���� ��M$: ��� ����� ��� ��� $;����������� ����������� 4��:)����
������� +��������� �� =̂;@���������9���� �� =̂�������������6��� �: =̂������������ ;E
pol i f emo: ~$ cat >nuevo_t ext o Est e es el t ext o que va a cont ener ( est as dos l i neas l as escr i bi mos nosot r os)
��������������� � ����������������������������
el f i cher o. ^D ( pul samos ^D) pol i f emo: ~$ cat nuevo_t ext o Est e es el t ext o que va a cont ener el f i cher o.
2 ������cat ����� ������#��������� B/ ���
9��(������ :��&����
- n ���9����������� � 4���������:����$������;�
- b ���9����������� � 4���������@�������������� � 4�����/ ���:��4�;�
- s 2 ���� ��< ��� �� 4�����/ ��������+�������<��� 4����4�
- A '����� �������������������/ ������������H^H@- ������������-�����+�D�!�����-��9��
��% ���������HM- H
�� ���$�������'�"���������������"�%�����cat
3.2.2. Comando wc
2 ������wc :(������� �;������������ � 4���@� /��-��������9������������#��)�������
��#�������������������������#��)��������������� ������@�����/�:�� � ���������;��� ����
9��������� �<������ 4���@� /��-��������:�����������;-� ���/���� #��)������������D�����@��
��������������#��)����@ #�� �������� �������� �
SI NTAXI S wc [ opci ones] [ f i cher os. . . ]
��wc ��� /� �� � ���6��������������9��)- ��������/ ���� :������@�/� ����@ ���������
����@���;�!�� ���������- c@- w-- l �������)���9������$�� ������������� ����������������@� -
������������� B/ ���2��� 9�������� ���/������#��)������������������ �����)�� �
������@ - �� �<����� ������ �� � ����� 4���@ � /��@ �������� :������������������ �� ����� �� ��
����#���������� �$���;�2 ��+�������6��� �������� �<������ 4���-� /��� ��#��)����* . c�
pol i f emo: ~$ wc - wl * . c 3 11 f 1. c 533 1118 dat a. c 24 121 x_2. c 0 0 empt y. c 560 1250 t ot al
��������������+<�#��)���@������� ����������� �������������
��������������� � ����������������������������
9��(������ :��&����
- c �� �������� �<��������������:�<������/-���;�
- w �� �������� �<������� /���
- l �� �������� �<������ 4����
�� ���$$������'�"���������������"�%�����wc
3.2.3. Comando sort
2 ������sor t ������������� #/A�������� � 4�������#��)���@����$� � � 4����������
#��)����-��������/�����#��)���������������,�� �������������������������������)��������� ��
����#�������- c-- m�
SI NTAXI S sor t [ opci ones] [ f i cher os. . . ]
• ��������� �$- c��- m@�������������E��� ��#��)����������#�����������������@ ��#�����@
������ ���� ���- ���������� � ����������
• !��- c@sor t ����� �$��������/�����#��)�������������������� �����@��)����I�����
����������������������(�
• !��- m@sor t ����� �$����$� � ��#��)����������#�������������9������#�����������@����
��9�����9�� ��#��)����������#��������A��������� ��������������!�������6@�����A���������
������9�� ������������� �
2 ������������������������#������� ����� #/A����/������ �����D�!��@��9������������ �$�
���������������2 ����#�����- f )��9������������+������-<��� �-���<��� �@- n�����9�� ���������
�� ���A��� :- �� #/A���;@ - b �+��� �� ������� ���� �� ������ ���@ ���� , B/ � �������� ��
������� ������#��������
�/��� ����� ��#��)����9�����������������������@�������@������#��������/ ��+��$���
#� �: 4���;-�� ����:������������� +<��������@����6��� �@���/� ���;�2�����������������������
���������/ :#��)���;��� +<�����9���������������������9������ ����������� 4������ �
��/���������� �sor t �������E
• 2 �������9������ ����������������� �$��� ������- t ��+����� �����������������:)-
9����6��������������A���- t -������ �������;�
• 2 �<�������������� 9����������: � �������������;�2��� ������������ ������+###-
- ###@ ����� KKK ��������� � �<���� �� ���� :�����$��� �� *;� +### ����� � ������ ���� ��
���������-- ###� ��������� < ����:���������A���@��������)��� #�� �� 4��;�2������9��
� �� ��� ������� ��� ����� �����+###- - ###@ ��� ��� ���A����2 �<���������� �� ������#��
������������<����������������������:. ;I �9��9��� �$9�������� �<����������I �
9��9��� �����): ���������� ;��� �<��������������������� ����:���������� �<����
���������@����/�������� �����;�=������� �<����:�����������;���������� �$������������
������#����������������������:���A���@�+�����-<��� �3���<��� �@���;@
(B���������������
��������������� � � ��������������������������
,������ - o ��+��� :��� �� ��������; �� �� ���/�� ��#��)���@)��9�� � ���� ��� �� ���4� ���
#��)����� �+��� � ����������2����������9����������� �$���������#��)�������#��)����������@
)��A����������������� ����� �$� ����������
���< ����@ ������C��������#����������
9��(������ :��&����
- b �+��� ��/ ����:������@�/� �����@����; ����������� � 4����
- d �+��� ����������9������� ������<������
- f �+��� ��#������������-<��� �-���<��� ��
- M ������9�� � ���������������������� ��������� ?���#�����HJANH@HFEBH@���HDECH�D�����
�+��� ��#������������-<��� �-���<��� ��
- n ������9�� � �������������������������<����:������������ ;�
- r ��������� ������
- o �������������#����������������#��)������ ���� �+��� � ����������
- t �������������#��������������� ����������������������������
+### KKK��� ���������������������:������������*;�
- ### KKK��� ������������� < �������������������:������������*;�
�� ���$(������'�"���������������"�%�����sor t
26��� ��E
• ,���� ��#��)������ ����������-������ ����+<�������������:��� l s - l �/��������� ��������
9�� �������� ������ ����������;E
pol i f emo: ~$ l s - l | sor t +2 - 3 t ot al 11 - r w- r - - r - - 1 l l or ent e user s 99 Oct 19 14: 35 nuevo_t ext o - r w- r - - r - - 1 l l or ent e user s 7869 Jul 10 1997 t er mcap - r w- r - x- - x 2 l l or ent e user s 41 Oct 19 14: 47 f i cher o1* - r w- r - x- - x 2 l l or ent e user s 41 Oct 19 14: 47 f i cher o2* - r wsr wsr wx 1 r oot r oot 0 Oct 19 11: 41 p*
• ,���� ��#��)������ ����������-������ ����+<�� ������������-�����A���+<�����?�E
pol i f emo: ~$ l s - l | sor t +5M - 6 +4n - 5 t ot al 11 - r w- r - - r - - 1 l l or ent e user s 7869 Jul 10 1997 t er mcap - r wsr wsr wx 1 r oot r oot 0 Oct 19 11: 41 p* - r w- r - x- - x 2 l l or ent e user s 41 Oct 19 14: 47 f i cher o1* - r w- r - x- - x 2 l l or ent e user s 41 Oct 19 14: 47 f i cher o2* - r w- r - - r - - 1 l l or ent e user s 99 Oct 19 14: 35 nuevo_t ext o
• !�����#��)������� ���-���������� ��-������ ��6�����E
pol i f emo: ~$ cat >ani mal es
��������������� � ����������������������������
oso ( est o l o escr i bi mos nosot r os) pez el ef ant e r ana ^D ( pul samos ^D) pol i f emo: ~$ cat >pl ant as pi no ( est o l o escr i bi mos nosot r os) enci na r osa al cor noque ^D ( pul samos ^D) pol i f emo: ~$ sor t pl ant as ani mal es al cor noque el ef ant e enci na oso pez pi no r ana r osa
3.2.4. Comando more
2 ������ mor e ����� �� ������ �� #��)��� )������ �� ��� �� �� ��+�� :��� ;� ��
������#����� �����#��)����@ ���������� �� � ����������@)��������� � ������������� 4�� ���4�� �
�����������$�������
SI NTAXI S mor e [ opci ones] [ f i cher os. . . ]
����$����� ��"���+����@��� �$��� ���+���������� �E
• �����������������E��$�����+���
• � ���ED��$��� 4���
• IE��������
!���$9����$������ #��)����������@ ������ 4����������� ������#������� ��� @
������� ���������������� $�)�����/@�����9����� ����� ������- p@9��)��9�� ���+�����
����� ���������� ���9���������$����� $������:��������� ������;�������������9�������������
����������������� B/ ���
9��(������ :��&����
- ### ������ �<����###�� 4��������+���
+### ������ �<����###�� 4������ 9��)-9�������$��
+/ ��+������������@)��9������������������� #��)������ ��������������� �����
- p ���9�� ���+����������������9���������$����� $������:������;
�� ���$-������'�"���������������"�%�����mor e
��������������� � �&��������������������������
3.2.5. Comando less
2 ������l ess ����������� �$�� �������������#��)������������2�����6���mor e@�������
���#������ ����,������� ����6��/��mor e ��9������������+����� ��"������)���� �������
)�������
SI NTAXI S l ess [ opci ones] [ f i cher os. . . ]
����$�-�������������� ��"���+�������������� �$�@������� ���� ���mor e@ �����������
D������"������� ���������� �-��������������������������@9�������������� �����man l ess�=����
����/� ����������� � 4���@ �9��)��������- N�
2 ������man��� �$l ess������������#��������
9��(������ :��&����
- N '������ �<������ 4��6���� 4���
�� ���$/������'�"���������������"�%�����l ess
3.2.6. Comando tail
2 ������t ai l ���������������� � ��������� �< ���� 4�������#��)���������#����������
��*< ���� 4���@������������� ������������<�����
SI NTAXI S t ai l [ opci ones] f i cher o. . .
,���������)/��� ��- n@9���������������#��������������� �<������ 4���9��)-9���������
����6��� �@����� � < ���� 4�������#��)���E
pol i f emo: ~$ t ai l - n 3 mi _f i cher o
��������#����������#��)���� ��$@������������� ����������@������4�� ������������@
�����9����� ����� ������- q�26��� �E
pol i f emo: ~$ t ai l - n 2 ani mal es pl ant as ==> ani mal es <== el ef ant e r ana ==> pl ant as <== r osa al cor noque pol i f emo: ~$ t ai l - q - n 2 ani mal es pl ant as el ef ant e r ana r osa
��������������� � ����������������������������
al cor noque
,B/ ������+� ��������� ������#�������9������������� �$����t ai l �
9��(������ :��&����
- c �������������#��������������� �<���������������� #�� 9��)-9��������:����$�� 4���;�
- q ���������4�� ����������#��)��������)-�����#��)�����
- n �������������#��������������� �<������ 4���9��)-9��������:�����#�����*;�
�� ���$2������'�"���������������"�%�����t ai l
3.2.7. Comando head
2 ������ head ����� �� ������ ��� � �� ������� � ������� 4��� �� �� #��)���� ��� ��#����
������ ��*������� 4���@������������� ������������<�����
SI NTAXI S head [ opci ones] f i cher o. . .
,���������)/��� ��- n@9���������������#��������������� �<������ 4���9��)-9���������
����6��� �@����� � ������� 4�������#��)���E
pol i f emo: ~$ head - n 3 mi _f i cher o
��������#����������#��)���� ��$@������������� ����������@������4�� ������������@
�����9����� ����� ������- q�26��� �E
pol i f emo: ~$ head - n 2 ani mal es pl ant as ==> ani mal es <== oso pez ==> pl ant as <== pi no enci na pol i f emo: ~$ head - qn 2 ani mal es pl ant as oso pez pi no enci na
,B/ �%����+� ��������� ������#�������9����������� ���head�
��������������� � �%��������������������������
9��(������ :��&����
- c �������������#��������������� �<���������������� ���������9��)-9��������:����$�� 4���;�
- q ���������4�� ����������#��)��������)-�����#��)�����
- n �������������#��������������� �<������ 4���9��)-9��������:�����#�����*;�
�� ���$5������'�"���������������"�%�����head
3.2.8. Comando grep
2 ������gr ep :��������������������� �� ����� �;������������� � 4�������#��)���9�����������
�� �����@ �� ����� 9�� ��������� �� ��"��� �� ������#����� ����� #��)����@ �� /����� �� ����� � ��I �� ��
������#��������+�����/������� �������������
SI NTAXI S gr ep [ opci ones] pat r ón [ f i cher os. . . ]
2 #���������������� �� ���������������� � ��������� � 4���9������������ �����:����
#������������������� ����������� ����������� B/ *;�D�����@������������� ����� +����$@
� ���������������A"���@-����@���������������
2 ������������������� ���� ���������������������,�����������/������9������������
��� ������+������ B/ �0�
���8����� �'��(�����
. !� 9�����������
[ ] !� 9������������� ���6�������+���������:����[ 0- 9A- Z] ;
^ !�����$��� 4��
$ .�� �� 4��
< !�����$���� /�:T_;
> .�� ��� /�:TM;
�� ���$6��1�%������� )��"���,��������������&���;������gr ep
!������4� �� ��������-����������@��9�������������/������������4�/� ������ �� �
����/� �����@���������� B/ �(���9�������/�������������9��#���������������4�:����6��� �@
9�������/�����������;@�����������������/���������� ����� ��������=����#���� ��������
� �������� �� �����4�I���� /������������������������� �� �)� @��� �9��A����/������������
���� �@�/��������������������/���������
��������������� � �0��������������������������
���8����� �'��(�����
x* x����������������* �����:x���� ���� ��������4�;�
x? x��������������*�������:x���� ���� ��������4�;�
x+ x����������������� �����:x���� ���� ��������4�;�
x{ n} x��������n�����:x���� ���� ��������4�-n���<����;�
x{ n, } x��������n���������:x���� ���� ��������4�-n���<����;�
x{ , n} x����������������*n�����:x���� ���� ��������4�-n���<����;�
x{ n, m} x����������������nm�����:x���� ���� ��������4�-n-m�<�����;�
�� ���$8��1�%��������������&�"�0��,��������������&���;������gr ep�
B�/�A��������+���� ��/�"������������ �$��� ����A������-��� �$� ���������1 �+������
�4�/� ��� ��/��4:| ;�
,������������������)������������������-<��� �-���<��� ������9����� ����� ������
- i � ��� ��#���� gr ep ������ � 4�� 9�� ��������� � �����@ ���� ������� �/����� ����� ��������������
��� �$��� ���������������E
• �� � 4���9�������������� �������� �$���- v�
• ������ �<������ 4���9������������ �������� �$���- c�
• ����� ����)����9������������ ������� +�� 4����� �$���- l �
�� �"������� 9�� 9������� /���� ������$ ��� �� +���� :C;@ ����4 ���#������� ��� �� ������ ��
��������� 2������� ������� ��� �$� ������ - e 6���� ���� �� �"������� �� ������ 9�� � 9�� �����
�����������������������@���� �"������������6��� �@�� �� �$�� �����H- v- H�� ��#��)������/����
�����/��E
gr ep - e - v- *
������6��� ��E
• >�������/�����������9��������������HaHE
gr ep " ^a" / et c/ passwd
• '������ #��)���i nf or me��� � 4���9��������+� �� /��HB���2!12BHE
gr ep - v " TOP SECRET" i nf or me
• '����� ��#��)������!9����������� 4�����4�E
��������������� � �(��������������������������
gr ep - l " ^$" * . c
,B/ *������ �������� ������������ ������gr ep�
9��(������ :��&����
- i ��)������������������-<��� �-���<��� ��
- v '����� � 4���9�������������� ������
- c '������ �<������ 4���9������������ ������
- l '����� ����)����9������������ ������� +�� 4��@�� �+��� � 4����
- e �������������#���9�� �9�����������������������"�������:-����������;�
- n '������ �<������ 4����9������� �"�����������#��)����
- s ������������6�������������� +<�#��)������������ ����
- q �����������+��� ��I�� ����������A"�������������
�� ���(9������'�"���������������"�%�����gr ep
2"��������������gr ep@��������6��� �f gr ep-egr ep@9���������������������� ���
3.2.9. Comando find
2 ������f i nd �������/����#��)������� ��/� ��������������2 ����������/<�9�������-# �"�/ �@
����������� /���� ��� ���/��@ ��?�@ #��)@ ���� B�/�A� ������� ������#��� �� � ��� �� ��/� ��
�������������� �9��/����@-����������+��� ������� �$���� ��#��)���� �� �$����
SI NTAXI S f i nd r ut as. . . [ cr i t er i os] [ acci ón]
• r ut as��� ���6���������������������������$�/�����f i nd/������� ������������-�������
�����/������������
• ������������ ����������/<�9���@-������������������9������� #�����/����:������/��@���
#��)@ ����; - � ����� �� ��������� : ����� �� ���/��@ #��)@ ����;� , B/ � ����+� ��
����/ � ���������� ������� ���/��� ����� ���������@ ���A��� �� ��� �� ��������� D�= - �1� ��
)��� ����D�=@/����������/�������������������/<�9���I��)��� �����1@����������- o
���������D�����@ ������� �������� �� �������� :! ; ���������� ��9��#������� ��������
:/��� ��#��)����9�������� � ���������;�D�����@�������������#���� �������9������ <�
� ����������� ��� �$��� ��A������� ������ 9�� �� ��A������ ��� �� ������� ������ �� � �)� @
��/����������������A��������/����������:\ ;@������� ����������� �@����
• acci ón�� ���9����/��6�����f i nd����$9�� �� �������)���9������#�9�� ��������������
/<�9����,B/ ��������� �������� �������������/ ���
�� �������� �����������@����� ��#��)���� �� �� ����������� �������� ����������� �����������2� ��
���������9������������<�������������������� �<����H- H���"�����9�� ������������������
� �������������9��� �������@�H+H���"�����9�� ������������������� ���������-��9���
��������:�����#���� ��������������������� �<�������+� ��������;
��������������� � &*��������������������������
�&������ �'��(�����5�����������!4�.��6�
- name nombr e >���#��)������-����/������������nombr e�
- per m modo
>���#��)������-���������������������modo�,������������������#������� #��������A����:���
���������&,���������������������"�����'��������������� ��+���&;���modo����������������+�������:- ;/���#��)����9�����+� ����� ������������������@-������������������+�����:+;@/���#��)����9�����+� +����� �������������������
- t ype x >���#��)������-��������� ����������x@�����x��������Ef ��/����#��)�������� ��@d��/���������������@ l ��/������ ������/� ����@ c��/��������������������������@����
- l i nks ### >���#��)����9�����+�� �<����###���� ����������������- KKK��+��#���������KKK�� ����
�������+KKK��+��#�������KKK�� ����
- si ze ### >���#��)����9�����+�����?���###/ �9��������+��������9��� ��?���/ �9��������
8� �/-��������������KKKk�D�����@�������- KKK��+��#���������KKK/ �9���-�������+KKK��+��#�������KKK/ �9����
- user nombr e >���#��)����9���������$�� ������nombr e�
- at i me ### >���#��)����9��)-�������������)��###�4���������- KKK��+��#���������KKK�4����
�����+KKK��+��#�������KKK�4��
- mt i me ### >���#��)����9��)-���������#�����)��###�4���������- KKK��+��#���������KKK�4����
�����+KKK��+��#�������KKK�4��
- newer nombr e >���#��)����������������9��� #��)���nombr e�
�� ���(��� ���"�������"��&��������� +�,�������������"�%�����f i nd
�&������ �'��(�����5�����������!4�.��6�
- pr i nt ����������� � ���������� ���/���� ��)��� �� �$���
- exec comando
26������ comando������������������� ������� ���/���� #��)��� �� �$��@��� �$���Y[@
9��������������������)����/���D�����@��������� #���� ������@��/����������������-
����:; ;�������������/�������������9��; ����������������� ��� �)� ;�����6��� �-exec cat { } \ ; )��9������������ ����������� #��)��� �� �$���
�� ���($�� ���"��������""���������� ���������f i nd
5���� +�����6��� ���������f i ndE
• >����#��)����9����������� ��� HaH �� � ���������� ��� - �� / t mp :- ��/����������� �� �/��;-
��������������E
f i nd . / t mp - name " a* " - pr i nt
• ,�� �$�� #��)���passwd��� �����-��������������E
f i nd / - name passwd - pr i nt
• '������ ����������� ��#��)��������#�������������� ��������������� ������ l l or ent e9��
��������������/ �9����������E
��������������� � &���������������������������
f i nd / home/ l l or ent e - mt i me - 7 - si ze - 2 - exec cat { } \ ;
• >���� ��#��)����9�����+�� ���/�� * . c-���+������ *�4�@-��/�A�9�� ��9�� �����
�������������E
f i nd / \ ( - mt i me +30 - name " * . c" \ ) - o - user f gar ci a - exec r m - f { } \ ;
�01-��9+0:1-�1�2��-9����������������� ������������� �������������/<�9��������/�����#��)���@-9�� �������������4� ��������� ��� �� ���/��� �� ��)���� �� ���������� ��� 9�� ���6�� �� �������@ ������9�� ��/����4� ���� ���/��� ��#��)������ ������������� @�� �+��� �����/�����#��)���9������9��� ���������������� ���/ ��@������������������ � ������� :������ �� �6��� �����������;@������9�� ����� �+� �� ������@-���� �������������� �)� ��������������+� �������
2������/ ��������/���������/�A���������������@���������f i nd�
3.2.10. Comando uniq
2 ������uni q ����� �� � ����� �� ��#��)��� � 4��� ��������� 2 #��)��� ��/� ���� ����������
���������������������#���� #��)����������-� #��)������ ��:����������� �����;�����������@��
��� �$��� �����-� ����������
SI NTAXI S uni q [ opci ones] [ ent r ada [ sal i da] ]
���� ���������#������� ��#��)������������� ��@A�������� �������@� -�������������
����"���,���������9�������uni q������������#������������������@������������/��� B/ �
9��(������ :��&����
- u ���9���� ������4�� � �� � 4��������������
- d ���9���� ������4�� � �� � 4�����������:�� ����4������;�
- c '����� �$9��������� 4��� �<�����������9�����������
�� ���((������'�"���������������"�%�����uni q
3.2.11. Comando comm
2 ������comm������������ � 4����������-��������������#��)����:f i cher o1-f i cher o2;
������������������@-+������ � �������������#������� �� ����E 4���9���� ��������f i cher o1@
4���9���� ��������f i cher o2- 4���9��������� �����#��)�����
SI NTAXI S comm [ opci ones] f i cher o1 f i cher o2
,���������C�@C�-C )���9�� �� �����������������������������@������������� B/ ��
��������������� � &���������������������������
9��(������ :��&����
- 1 ���9������������� �� ���������: 4���9���� ��������� ������#��)���;�
- 2 ���9������������� �� �����+���: 4���9���� ��������� ��+����#��)���;�
- 3 ���9������������� �� ���������: 4���9����������/��#��)����;�
�� ���(-������'�"���������������"�%�����comm
3.2.12. Comando cmp
2 ������ cmp :�������; ����� �������� ���#��)����@ �� ��������������������� !��� � ��@
�������������6�9����������� �<������/-��:�������;�������� #��)���-� �<������ 4������������
������ ��#������ ����� ��#��)������������ : � 4���-�������� �� �����������$��� �� �;� �� ��
#��)��������+� ��@������������
SI NTAXI S cmp [ opci ones] f i cher o1 f i cher o2
cmp ������������ ��������#�������!�� ������ - l ����������� �$����� ���#�������������
�� ����9�����������E���������� ��������#������:/-��;@����+�D�!������� �� �������9���������
� ������#��)��� �� �� ��������@-����+�D�!������� �� �������9�� ����� �� � ��+����#��)��� �� ��
���������,B/ &�����������������#�������9������������ �$����cmp�
9��(������ :��&����
- l ������� ������� ������#����������������� �� ���� ��������- ����������9����#������
- s ���������������� ��#��)���������#�������@����9�����������������
�� ���(/������'�"���������������"�%�����cmp
3.2.13. Comando lpr
2 ������l pr :�� ����� ���;���������������������� ���������D������� �����#��)������
��������I������������#�����+���@��������� �������������
SI NTAXI S l pr [ opci ones] [ f i cher os. . . ]
!�� ������ - # ��+��� :��� ��������;���������� ��������� �<������������������������ ��
��������� B/ ��
=�/�����������9������%��������,�������&���;��������,�����&)�"���"&���������%),����������@�� 9��
���+����� ����� 9������������ �$���:�����)��������������#��������;�
��������������� � & ��������������������������
9��(������ :��&����
- #nnn nnn ��� �<������������
- Pxxxxxx xxxxxx ��� ���/���� ��������9��)-9����� �$��
- r ���9�� ��#��)��������������� ����������$#�� �$� ����������
- m ���9��� ������������4�������6���������� ��������������� ��/6�)-���������
�� ���(2������'�"���������������"�%�����l pr
3.3. Comandos de manejo de unidades y dispositivos 5��������������������� ���������9�������������������������-���9������O�/����
9��� �������� �������������������������������#�������<��������@��+��$�����<����
��/� ��������������!���������/ �9����?������������������$������� ������:����6��� �@��
�����������������9�������!=C1�';@����������������������9�A������ ��/� �������������9�������
������ ��/� ����������� ���������������������:����� �����;@-��/�A�)-9��������� ������
�� 9�� ���� ������ � ��������� �� ����� :�������� �����;� �� �� )����� ������������ ����
���������� :��� �6��� �@ �������� �� ���9���� ��� ������� � ����������;@ ������� �?� ������/ ������ �
��/� �������������-������ ��#���������������$��@�� ���������� �������������/6���� ��������
��������
D�����������$� ������� �����������/������������������������� � �����������������
����� �� ����� 2�� ����������� ����� ��/�� �� ��� ��������� �� ���� ����� , B/ % ����+�
������������� ���������,���"���������� ���
�01-2�
,�����/����� ����������� ��������������@����#��)���������� ��9�����/������ ����������/ dev�,���������������������������:��/ �9���@�����������I-����������@������������ ;�,��������� / dev����������/�������������������<�����9��
��������� ������ �� ���� )��7������������������!���������#������������������@��������������#������� ����������
�� ����������/ dev�
,���"����/����� �+�� �����'�C=��3G ����7�@��� �9���"������������������� ����������
� ��������9��������#�����'�C=��3G ����7��
/��������7�� :��&����
hda ���������������:�=2;�
hda1 ���������������� ���������������:�=2;�
hda2 ��+������������� ���������������:�=2;�
hda3 B��������������� ���������������:�=2;�
. . .
hdb ��+�������������:�=2;�
hdb1 ���������������� ��+�������������:�=2;�
. . .
hdc B��������������:�=2;�
hdd !�������������:�=2;�
. . .
f d0 ������������������# �"�/ ��
��������������� � &���������������������������
/��������7�� :��&����
f d1 ��+���������������# �"�/ ��
. . .
�� ���(5�����������������&�����������������������"����������
3.3.1. Comando mount
2 ������ mount ��� ������� ����� �� ����� ������ �� #��)����� =�/���� ������ 9�A �����
�������-��9�A������������ ��/� 9������������� ��/C��/� ��������������)������
SI NTAXI S mount [ opci ones] [ di sposi t i vo di r ect or i o]
• di sposi t i vo�� +���� ���������/ dev9��������#��� +<�������������������@����6��� � ��
����+������ B/ %�
• di sr ect or i o�� +<�����������9�������A�������������������������9��������4�@�����������
�� )+ ��� �� ����������� :������� ��+ ������;@ �� �������� ������ ��������� ������� �� ���
����������I����$���������� �����������@� ����������9������������/�
�� �� ������#����� ����������� �� ����������@ mount ��������� �� ����� �� �� ������������ ��� �����
��������
,���"��������������������#��)����:#�����������������������������������������;@��� �9����
����/ �9����/�A����+���9�� ������� ������#�����9�������� ����������� �����������2��� �
)������������ ������- t ��+���:�������������;����� /�� ��9��������/�� ��������������
#��)����Emi ni x@ ext @ ext 2@xi af s@hpf s@msdos@ umsdos@ vf at @ pr oc@ nf s@ i so9660@smbf s@ncpf s@af f s@uf s@
r omf s@sysv@xeni x@coher ent ����� �����,���"�������������������� ������ ��������#��)����@����
��������������������� ��"� 4���������
���� ����� �� ������������ �� � ������ ��� ������� ��� � �����������@ ��9�� ����� �� �������
������������ ����������� ��������������:�������9�����+� �������������������/�� ���������������
����6�;�2��������@�������������������� ������� �������������������� � �������� ������- r @��
#���9��������������������������#����
2 ��+�������6��� ����� ���������������� ������������������ ����������/ mnt E
mount / dev/ hda1 / mnt
2�� ��+���������@������������9������ ��������������'���"��/ mnt E
mount - t mi ni x / dev/ f d0 / mnt
,B/ 0�������� �������������������� ������mount �
��������������� � &&��������������������������
9��(������ :��&����
- r '���� ����������������� � ������
- t �������������#��������������� ��������������#��)��������������� ������
�� ���(6������'�"���������������"�%�����mount
3.3.2. Comando umount
2 ������ umount ����� �� �������� �� ����������� ���������� ������ ��� mount � =�/����
������#���� �������������9�������@�/���� �����������������������
SI NTAXI S umount [ opci ones] { di sposi t i vo| di r ect or i o}
�� ����������� �� ����� �� ��������� ����� �����"����� :���';@ �� �����@ ����� �������� #��)����
/������@�������"��������������-����������������#�����������$� ������������
������������� ����������������������,����+��������6��� ���������� ���6��� ��������6�
���������� ������mount E
umount / dev/ hda1 umount / dev/ f d0
3.3.3. Comando df
2 ������ df :���&�����; ����� �� ���� �$� � ����� �� �� ������9�� �� ��������� ������� �� �
������E����@������
SI NTAXI S df [ opci ones]
����6��� �@� ��+������ ����������9��� ��������#��)������pol i f emo����#�����������������
:sda2@�����������4$@-sda3@����������/ home;�2 ����������������������������(0��**�/ �9���
���*��/-����* :�� �����@ �@0(F>;@ �� 9�� ��)��������0��*�*/ �9��� :� �L;-9���� �/������(&�&�&
/ �9����2 ��+���������������������������(��0%&/ �9���:�@*(F>;@�� 9����)�����������0����:�
&(L;-9���� �/���0�*� ���
pol i f emo: ~$ df Fi l esyst em 1024- bl ocks Used Avai l abl e Capaci t y Mount ed on / dev/ sda2 1982006 684010 1195545 36% / / dev/ sda3 2191875 1218246 860324 59% / home
�*D���������� �$�/ �9�����&��/-��������9��������9�� ���������������� +��������
��������������� � &���������������������������
B�������9����������9��������������0�*'> �/����������/����)������������ ����������/ home:-
�����/�����������;����@��F>�������/����� �������������������� ������
3.3.4. Comando mdir
2 ������mdi r :��7$-����������'; ����� �� ���� �$� � ��������� �� �� ���9���� :� �� +���� ��
�� 9���������;��'�C=��3G ����7� ���������������������������� ����������9����� : �������
��/������������9��#�������;�2 ����������������� ��������������� �)��� ������di r ��
'�C=��3G ����7��
SI NTAXI S mdi r [ opci ones] di r ect or i o
2 ������������������#�������������$� ��#����������,���"-'�C=��3G ����7�E
• 2 ���/���� �������������#��������� �����'�C=��3G ����7�@��+��������������:: ;�
• ,/�����������������������������������:\ ;@����9���� 9������� �������:/ ;�
2 ��+������ �6��� � ���� �$ � ��������� �� ���������� ���� 9�� �� �������� �� � ���9���� '�C=��
������������� ����������������9�����E
mdi r a: / copi a/ * . *
,������#�������9������� ����������������� B/ (�
9��(������ :��&����
- w '������ �������#�������)�:����/ w��'�C=��3G ����7�;
- a ��� �-� ��#��)������� ����
- f ����������#���������/��� ������ �/����� �����:�4�����������;�
�� ���(8������'�"���������������"�%�����mdi r
3.3.5. Comando mcopy
2 ������mcopy :��7$-�����'; ����� �������#��)���� ����� � ��/� �� ����������� �� ,���"- ��
���9���� :����� �� +���� ; ��� #����� '�C=��3G ����7� ��� �������� �� ����� �� �������� ����� ��
���9�����: ���������/������������9��#�������;�,������������� �$�������)���������'�C
=��3G ����7��
SI NTAXI S mcopy [ opci ones] or i gen. . . [ dest i no]
,����������������/�����#��)����3������������� �����'�C=��3G ����7���+�� ��������+ �
9����� ������mdi r �
��������������� � &%��������������������������
�������������#��������#��)���������+��@-���������@� ������������������������B�/�A��������
������#�����#��)����������+��-��#��)��������������@-�������������������� ��������/���.�� �����
�������������#����� ���#��)��������+��@-� ������������ ���������������#�����
,���������9�������mcopy��� ����������� B/ �*�
9��(������ :��&����
- t !���#��)��������"��:)��������������CRCR+LF@-��������;�
- n ���������#���������������/������/��#��)����,���"�
- o ���������#���������������/������/��#��)����'�C=��3G ����7��
�� ���-9������'�"���������������"�%�����mcopy
3.3.6. Comando mkfs
2 ������mkf s :��&��������'����;��������������������#���������@��9����,���"��������
������#�����������������#��)�����
SI NTAXI S mkf s [ opci ones] di sposi t i vo
=���������� ������#�� +��� �� �� ������������ �� ����� :�������/� ��� �� ��������;� ,B/ % :��
��+��&�;����+� +������ �����������������������,���"�
!��� ��������- t ������������������������� ��������������#��)����:������� �����mount ;�
D�����@��� ������- c)�����9��������#�9�� �����#������ �������/�����/ �9����?����
9��(������ :��&����
- t �������������#��������������� ��������������#��)��������������� ������
- c !������/ ��/ �9�����#���������
�� ���-�������'�"���������������"�%�����mkf s
3.4. Comandos de manejo de procesos O�/����:����������19N�,��������� ��#�.�� ��+����;9��������������+��9��������
�6������� �� �� ������ ���� �� �� ������� - 9�� �� �������� �� ������#��� ������� �� �<���� ���
��� ���������������������),�$*�
2��������)�� ��������� ���������9�������������6���������������
3.4.1. Comando ps
2 ������ ps :�������� ������; ����� �� ������ �� ����� �� �� �������� 9�� ��� ����� �� �����
�6��������
SI NTAXI S ps [ - ] [ opci ones]
��������������� � &0��������������������������
,� �������� �� ���� ������ �� ��/�� ������#��� ��� ���+<� +���� :- ;�,� ��������� ���+�� �� ps �4
����/�� +����I������)���������� :��9���� ������@����������������6������������;�
��� ��#����ps ����� �� ���<�������� �� �� �������� �������������� ������9�� �6����ps@���
��+��������#������������������E
• ��=E�<����������#���������������
• BBOE���/���� ������ �������������� ���� �6�������:-9�������� �6�������;�
• �BDBE 2���� �� �������E �� ��� ��� � ��+������ ��+��#����ERE�6�������@ SE������� :�� ���;@
TE����:�������� +<��������;@ZE���������
• B�'2EB�����9�� ���6����������� �������:����� < �����$9������6�������;�
• !�''D�=E���/���� ������9���6����:��� ����������������;�
����6��� �E
pol i f emo: ~$ ps PI D TTY STAT TI ME COMMAND 2500 p1 S 0: 00 - bash 2897 p1 R 0: 00 ps
,�����������ps����������� B/ ���
9��(������ :��&����
l .����� �+�E�����������#���������/������������
u '�������#���������/��� ������������������ �������-� ���������6��������
s '�������#���������/�� ���? ��9�����6����������
m '�������#���������/�� �������9�����6����������
a '�������/�A������������������������
h 2 ���� 4�������/�$��:��� ���4�� ���� ��� ����;�
r �� ������� ����������9����������6�������:�� �������;�
�� ���-$������'�"���������������"�%�����ps�
3.4.2. Comando kill
2 ������ki l l ��������������? �������������� ��������������������������/�� ��? @
�����������������������6�������:������;�,��? (:��F`�,,;��������� ������������ �����ki l l
����� ��������������@��)4�����/���
SI NTAXI S ki l l [ opci ones] pr ocesos. . .
,������������������#������������,�$�������+��� ��=������������������������������E
��������������� � &(��������������������������
• ��� �$�� ������ps�
• D �6�����������������+����� ��:��������&�� 4�����������;@� ���A���������������
��������� ,�$�� �������9��9�������+����� ���
,������� ������9������������ �$���- s@9�����������������������������#���� �<��������?
����� :������� �����/��W���-<��� �W����<����;������ � ��? ���������/ ������������ �$�
������- l �E
pol i f emo: ~$ ki l l - l 1) SI GHUP 2) SI GI NT 3) SI GQUI T 4) SI GI LL 5) SI GTRAP 6) SI GI OT 7) SI GBUS 8) SI GFPE 9) SI GKI LL 10) SI GUSR1 11) SI GSEGV 12) SI GUSR2 13) SI GPI PE 14) SI GALRM 15) SI GTERM 17) SI GCHLD 18) SI GCONT 19) SI GSTOP 20) SI GTSTP 21) SI GTTI N 22) SI GTTOU 23) SI GURG 24) SI GXCPU 25) SI GXFSZ 26) SI GVTALRM 27) SI GPROF 28) SI GWI NCH 29) SI GI O 30) SI GPWR
�����#����ki l l ��� �$ ��? SI GTERM@)/��� �������� �$���/�������������!���- s�� ������
���)/��� @��/�A�������������� @ �����/����� � ���/��� �<������ ��? ����������� ��+����� ,��
��+��������6��� �����4� ��? �������� ���������-�,�$��� �&� :����� �������������9��� �����;E
ki l l - 9 2543 ki l l - s 9 2543 ki l l - SI GKI LL 2543 ki l l - s SI GKI LL 2543
������������ �� �������������? ����������9�����������������:�������9��A �����
)-�6������;�
,B/ � �������� �������� �����������������/ ���������������
9��(������ :��&����
- l '������� ������� �����/�������? -����<������
- XXXXX - XXXXX��� ���/����<��������? 9��)-9��������
- s �������������#��������������������#���� ���/����<��������? 9��)-9��������
�� ���-(������'�"���������������"�%�����ki l l
3.4.3. Comando top
t op������������,���"�������ps�'�������#���������/�� ������������������ ��9���@���
��#��������9��� ���������#����������������������� ����+� ������������
3.5. Comandos de administración ,���������9��������������������������������������� �������������� �������D +����
�� ������������� �$������� �����������I������������� ������������������ �����������
��������������� � �*��������������������������
3.5.1. Comando passwd
2 ������passwd :����(���; ������� �� ��������/�� ��� �� �� ����D�����@ � �����������
�������/�� � ��������������������
SI NTAXI S passwd [ usuar i o]
2 �����������/���� � ����������/���� �������19G��� �� ���� ������������ �@�� ��+��(�
3.5.2. Comando shutdown
2 ������shut down :�"�����( ;�������������� �����������������������+���� ����������
O�/����9�� �������������������������+����������)/����������������!��shut down@�������
�������� ����������������� �+��@���������#���� �������������������� ������������������@
��9�������#�� �$������/6��������������
SI NTAXI S shut down [ opci ones] hor a [ mensaj e]
• hor a �� )�� ��9�� �������$�� ��������� �� �������=���� �6������� �� ������-)��
������ ��������������������9�����+<�������������������� �������,)���������������#���
��#���/�� ����� ����2 #�����/�� �����hh: mm:����16: 25@ ������-������������� ����;I
� #����� �� ���� �� +mm :���� +15@ ������ �� �& �������;� B�/�A� ������� ��� �$� � /� now@
�9��� ����+0�
• ����6���������6�9�������4������������������#������� ��� ����������������"������
������������ /����/������������� ���������� ��
����6��� �@���������������� ����������!=C1�'@���������9���+�� ��������@-�������
���� ��+���������������+������ $����*�������E
shut down +10 " El si st ema ser á i nt er r umpi do par a i nst al ar una uni dad de CD- ROM"
,���������9���������������������������� B/ ���
9��(������ :��&����
- k ���� ���E���4� ����6� ���������@�������������� �������
- r ���9�������A����������� ����������� ��������������������
- c ����������� ������������������+������������������#���������� )��@�����4������������������6� ����������������� ��9��� �+����)���� ���
�� ���--������'�"���������������"�%�����shut down
2"�����������������9������������������ ������Ehal t -r eboot �B����� ����/�������� �$�����
#����"� �������� ������������
��������������� � ����������������������������
3.5.3. Comando adduser
2 ������adduser :��������;�������/����������������������@��#���9���������������
�������adduser ����������������-�� ������������ �$������ ������������
SI NTAXI S adduser
!�����6��������������+��@�������������� �������� �����������E���/�������� @�<������
������@�<������+����@����������"���@�)� @-#��)���"��������� ������D�����@���������� ��������
���������� ��@�������/������ ���@�����)�@�� A#���@����.�� �����)/��9����+�� ���� �������
������������2����)������adduser ������������������ �������#����@���// ������� ���������@
��� �9���� �-��4�� ���������/��������� ��� ���-������ � ������������
5����� ��+�������6��� �@��� 9�������� ��������� 9�� ������user 133��� ��� ���
��+���� ��"����� ������� �����������E
pol i f emo: ~# adduser Logi n name f or new user ( 8 char act er s or l ess) [ ] : user 133 User i d f or user 133 [ def aul t s t o next avai l abl e] : I ni t i al gr oup f or user 133 [ user s] : user 133' s home di r ect or y [ / home/ user 133] : user 133' s shel l [ / bi n/ bash] : user 133' s account expi r y dat e ( MM/ DD/ YY) [ ] : OK, I ' m about t o make a new account . Her e' s what you ent er ed so f ar : New l ogi n name: user 133 New UI D: [ Next avai l abl e] I ni t i al gr oup: user s Addi t i onal gr oups: [ none] Home di r ect or y: / home/ user 133 Shel l : / bi n/ bash Expi r y dat e: [ no expi r at i on] Thi s i s i t . . . i f you want t o bai l out , hi t Cont r ol - C. Ot her wi se, pr ess ENTER t o go ahead and make t he account . Maki ng new account . . . Changi ng t he user i nf or mat i on f or user 133 Ent er t he new val ue, or pr ess r et ur n f or t he def aul t Ful l Name [ ] : Usuar i o 133 de si st emas oper at i vos Room Number [ ] : Labor at or i o de i nf or mat i ca I I Wor k Phone [ ] : Home Phone [ ] : Ot her [ ] : Changi ng passwor d f or user 133 Ent er t he new passwor d ( mi ni mum of 5, maxi mum of 8 char act er s) Pl ease use a combi nat i on of upper and l ower case l et t er s and number s. New passwor d: Re- ent er new passwor d: Passwor d changed. Done. . .
��������������� � ����������������������������
, ��#������� �� ����� ������ 9��� ��+����� �� �� ��)���� / et c/ passwd :���� �� � ������ -
������ ��;-/ et c/ shadow:� ����� ���������@���������;�
3.5.4. Comando chsh
2 ������chsh :�"� ����"���;������������/��� �)� �����#������������������������������
D�����@� ������������������/��� �)� ���� 9�����������
SI NTAXI S chsh [ - s shel l ] [ usuar i o]
!��� ��������- s�������������#���� ������)� :���)��� ���+��9��#�����������������
�)� �����������#������ ��������@#����������#������������@����adduser �2�� ��+�������6��� �@�
�������������/�� �)� �� ������l l or ent e��9����/ bi n/ csh�
pol i f emo: ~# chsh l l or ent e Changi ng t he l ogi n shel l f or l l or ent e Ent er t he new val ue, or pr ess r et ur n f or t he def aul t Logi n Shel l [ / bi n/ bash] : / bi n/ csh
B�/�A�����4)/����)��)���� �$���- sE
pol i f emo: ~# chsh - s / bi n/ csh l l or ent e
3.5.5. Comando chfn
2 ������chf n :�"� �������� ���;�����������#��������������������� ��@9�����������6�������
��������� ���� � ���������addsuer �D�����@� ������������������/�� ������������ ����
�� 9����������@������#������ ��������������
SI NTAXI S chf n [ opci ones] [ usuar i o]
,������������ �����E���/������ ���@�����)�@�� A#����� �����)�@�� A#�������-������!�� �
���������� B/ �&�������������#��� ������9��)-9����/�������������#��������+��������@�
���+��#��������#������������@����adduser �����6��� �E
pol i f emo: ~# chf n l l or ent e Changi ng t he user i nf or mat i on f or l l or ent e Ent er t he new val ue, or pr ess r et ur n f or t he def aul t Ful l Name [ ] : Jesús M. Al var ez Ll or ent e Room Number [ ] : 101 Wor k Phone [ ] : 2321 Home Phone [ ] : 959222222 Ot her [ ] :
��������������� � � ��������������������������
9��(������ :��&����
- f �������������#��������������� ���/������ ���:����� ���;�
- r �������������#��������������� �<�����������)�:����� �����;�
- w �������������#��������������� �� A#����� �����)�:(��&��"� �;�
- g �������������#��������������� �� A#�������:"�����"� �;�
- o �������������#�������������������#�������:��"��;�
�� ���-/������'�"���������������"�%�����chf n
3.6. Comandos de obtención de información ,�����������������������������/�������������#�������@���� #��)-)��@� ���/����
������@ ������������9���������/6����� ��9���@����
3.6.1. Comando who
2 ������who �������������� ������������������������������������� ��9��������
SI NTAXI S who [ opci ones]
������������#�����������@who�������� �������� ��+��������#�������@����������E���/��
�� ���� @ ���/�� �� ������ ����� � 9�� �� ������@ )�� �� �����@ ��������� ����� 9�� �� ������� ���
�6��� �E
pol i f emo: ~$ who l l or ent e t t yp0 Oct 22 10: 18 ( j mal . di esi a. uhu. ) ggal eano t t yp2 Oct 22 11: 13 ( ggg. di esi a. uhu. ) r oot t t yp1 Oct 22 11: 03 ( : 0. 0)
,������� ��������who��H- mH@9����/�A�������������/������Ham i H�2��������@who#������
����� ������whoami �
3.6.2. Comando whoami
2 ������whoami :("������O;��������/���������������/����������������������������
SI NTAXI S whoami
26��� �E
��������������� � ����������������������������
pol i f emo: ~$ whoami l l or ent e
3.6.3. Comando tty
2 ������ t t y ��������/������ ���/������������������������������ ������ ��� 9��������
��/6���:������������ 9����� �$�������������������;�
SI NTAXI S t t y [ opci ones]
����6��� �E
pol i f emo: ~$ t t y / dev/ t t yp1
3.6.4. Comando id
2 ������ i d ���������� � ���/�� �� ������- �<���� �� ������#������ �� ������ ��� :��=;@ �4
����� ���/���� ��+�����-����<������������#������:F�=; ��9���������$��
SI NTAXI S i d [ opci ones]
����6��� �E
pol i f emo: ~$ i d - a ui d=1000( l l or ent e) gi d=100( user s) gr oups=100( user s)
3.6.5. Comando date
����������� �$�-��/�� #��)-)���� ���������������� �� ������������������/��
#��)-)���
SI NTAXI S dat e [ opci ones]
����6��� �E
pol i f emo: ~$ dat e Fr i Oct 22 11: 18: 33 CEST 1999
��������������� � �&��������������������������
3.6.6. Comando cal
2 ������ cal ������ �� � ������ �� ��� ��� � ��� �$��� ��������� ������ ���� ������ �
� �������� ?���� ����� 9����������� 9����?����������������+<�?�@������� � ��������
��� ��� I �� ������#�� �� ?�@ ���� �� ���@ �� ������ � � ������ ���� ��� �� ?� ������#����I - �� ��
������#�������������?�@���������� �� ������������ ?���������
SI NTAXI S dat e [ opci ones] [ año [ mes] ]
����6��� �E
pol i f emo: ~$ cal Oct ober 2000 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
3.7. Comandos de control de sesión 2������������������� �����-� ���� �������
3.7.1. Comando exit
2 ������ exi t ��� ������� /����� � �)� @ -���A ������ ��� � �� ������ �� � �)� ����� @
� ���������� ��������� �������
SI NTAXI S exi t
3.7.2. Comando su
2 ������su:���������;������������������ ���������������������@������� 9��������������
������#����������/��:��� �������������;�
SI NTAXI S su [ usuar i o]
!��������������@����6������ ������)/��9������������ � �������6��� �E
pol i f emo: ~$ su chus Passwor d: pol i f emo: / home/ l l or ent e#_
��������������� � ����������������������������
D)�� ������� �6���������������� ��#�A���� � ������������ ��#�� �$� � ������@)-9��
� ���� ������)� ��9��������@���exi t @��� �9�������+�������+���� ������������
�/��� ���������� ��������������������������������������� ��������� �$������
/����@������������������������@-������������������� �9������/���)�������
3.7.3. Comando login
�� ��� �� �� ������ ������� su@ 9�� ��� ������� �� ��� ����� �� � ������@ ��� )/�� � ���
������������ ������2������������6���������������������$9��������������������� ������@-
��� 9���������������������������
SI NTAXI S l ogi n [ usuar i o [ var i abl es de ent or no] ]
D��#������ �� su@��� �+�� �� ������ ������ ������� :�� �"������;@ ������9�� ������exi t @ ��
������� ����"������� �������� �+�����+���� ��������������D�����@ l ogi n)��������������
��������� ��@ ��� �-���� � ��/�� ����������"��� �� ������@ �6������� �� �� ������� �� ��������� :���
�����&�&������������ ������= �� ��+��((;@����
2"����������#������������l ogi n-su@����������������� ��
3.8. Comandos de comunicación
3.8.1. Comando write
2 ������wr i t e������������������������6���������� ���/�������#���� ���/����������
-@������ �����@� ���/���� ����������������� :��';��� 9����/�������� ����6��
SI NTAXI S wr i t e usuar i o[ @host ] [ t t y]
������������/������6���������9�� ��������������������9��������@������#������ ���/��
���� ����� ��9���������������� ���/����������@:�������� ����a;�
2 ����6�������������� ������������@-� ���������� �����/���� ������ 9�����A��� �$���
:�� ��������"� 4��������;�D�����@������ ����6�����/����������������� � ���������-� ����������
����6��� �@� ������l l or ent e�����/� ������chusE
t er mi nal del usuar i o l l or ent e pol i f emo: ~$ wr i t e chus Hol a chus, est oy aquí . ^D
t er mi nal del usuar i o chus Message f r om l l or ent e@pol i f emo. di esi a. uhu. es on t t yp1 at 19: 23 . . . Hol a chus, est oy aquí . EOF
��������������� � �%��������������������������
��� ������������������������������ ������@�������������������
3.8.2. Comando mesg
2 ������mseg:��������;������������-�������� ���������������6����������������wr i t e�
SI NTAXI S mesg [ y] [ n]
!�� ������y@ ������ ���������@-���n@ ����������������������#�����������@mseg ������
������������������ � ��������� :Hi s yH��������@Hi s nH�����������;-�������� � ����
#�� �$����:*��������@������������;
3.8.3. Comando mail
2 ������ mai l ������� ����� ����6�� �� ������ � ���������� 2�����#����� �� ������@ �� ���4 �
����6������������������ ��9���@����������������������#��������/������9����
SI NTAXI S mai l usuar i o[ @host ] [ opci ones]
2 ������� ����6�:���C���;@�4����� ��"���� ������������� �����������������/6���
����� � ������ @ � ����� �� ���+����� ��� � ������ ���� �� 9�� �� �����/ � ��"��� 2� � ��� �� 9��
��/6���������������������������)������/��4@� ������������������� 4��: ����������� ��)���;
9�� �������� ��� Hsubj ect : H� 2 ����6� ������ ��� �� 4�� 9�� <�������� �������� �� ����� :. ;� 2���
������������������������#����������� ����������������������
����6��� �@�������������6� ������a�)����E
SI NTAXI S pol i f emo: ~$ mai l l l or ent e@uhu. es Subj ect : hol a Hol a. Acabo de l l egar . Sal udos. . EOT
3.9. Comandos de cálculo 2���+����������������������� �$��������������������@ �+���@�����������@����
3.9.1. Comando expr
2 ������expr ������� ���"�������������A�����2 ���� ����� �� ������������/��� � ��
��������
SI NTAXI S expr expr esi ón
��������������� � �0��������������������������
, expr esi ón ������������ ��� ����� ���� �� :�<����� ������������� ����������;-���������@
������� ������� ��� �������� ,�� ��������� 9�� �������� ��� �������� ������ �� �� � �)� :���� ��
��A������;��/����������������������/��������������������������� ���9������������+��#����
������ �,B/ ���������� ������������������������������������ ������expr �2"��������������
����A�����@ �+���� - �� ���6� �� ������ ,����������� �� ��������� ����� ��� *����# �� - � ����
��������I ����������� �+������� �$�� � ��*����# ��-�� 9�����<��������������*�������������,��
���������������������� �$����� ���� �������������
0������� �'��(�����
+ �������������
- 1�������������
* ������������������
/ =�����������������
% '��� �:������� ��������;�������������
< !��������� ���I���
<= !��������� �����������
= !���������������
== !���������������:��A�����=;�
! = !������������ ������
>= !���������'�����������
> !���������'���
| -% �+����
& #$ �+����
( ) ��������������#���� ������� ������������
subst r =���� ������/�����2 #�������subst r cadena posi ci ón l ongi t ud@-����� �� ��l ongi t ud��������������� ��������posi ci ón�� ����cadena�
l engt h =���� �� ��+�������������2 #�������l engt h cadena�
i ndex =���� �� ����������������������������2 #�������i ndex cadena muest r a@-����� �� ���������� ����cadena�� ��������������� ��������������� ����muest r a�
�� ���-2��<�����������)��������������"�%�����expr
2 �������������������� ��+������E�������-%@�������#$@��������������������@���������
��������@������������� ��� �������
2 ��+�������6��� ������������������������������ ���/ �CONTADORE
CONTADOR=` expr $CONTADOR + 1`
3.9.2. Comando test
2 ������ t est ����� �� ������/� �� ���������� !��� ���� ���@ �� �#���� ���+�� � ��� ��
���������������/����������@���������A"���:�����*;@-����@��������������:���������������*;�
��������������� � �(��������������������������
SI NTAXI S t est expr esi ón
2��� ������ �� ��� �$ ��� � ���������� i f - whi l e 9�� �������� ��������� /�� �� ��������� ��
���+������������������ �)� : ��������������� �����G���������� ����"@�� ��+��(�;���)���
���#��� ��������������������� �����������@�����������"�� ��������2�������� ������)������������
������ ���@����9����/�������/���� ���� �����E
SI NTAXI S ALTERNATI VA [ expr esi ón ]
2��� ���� ����)����$9������H[ H�������+��@���������������� �� ������ t est @��������
+�������� ��/� ���������������������$������/����� ������6������������������� ����������
� ����)����$9������-� ��������������� �"��������
,�����/ ���"���������������+���� B/ �%�B��� �9������#�����#��)����@���# ����� #��)���
��#����� �� �"����� D�����@ �� ������ ���/��� ���� �"��������� ��� �$��� �� ��������� �� B/ �0� D
������������������ +�����6��� �������������E
• !�����/� �"�����������#��)��� ���/ t mp/ st ast us�
• !�����/���� ������������� ��� �4$�
• !�����/���� �<�������������������������-��9��&���
• !�����/���3���3 &��%�����������������#��)���:���������������@������ ��@����;�
• !�����/�9��� ������������� ��� "���@-9������������/�������������������
[ - f / t mp/ st at us ] [ " / " = ` pwd` ] [ ` who | wc - l ` - gt 5 ] [ - d / t mp/ a35627 - o - f / t mp/ a35627 ] [ \ ( $HOME = ` pwd` \ ) - a \ ( ! $USER = r oot \ ) ]
����� �$�� ������who:��+�� 0;���/������� ������������������������
��������������� � %*��������������������������
������� �� ;��������� �����7���������������
- r r ut a r ut a����#��)��������������� �����:��������������� ���;�
- w r ut a r ut a����#��)�����������������������:��������������������/��;�
- x r ut a r ut a����#��)����������������6�������:��������6����� �;�
- f r ut a r ut a����#��)������� :��������������@�� ��@�����������@����;�
- d r ut a r ut a���������������
- b r ut a r ut a�����������������/ �9����
- c r ut a r ut a��������������������������
- L r ut a r ut a������ �����/� ����
- s r ut a r ut a����#��)��������?��-��9�������
- O r ut a r ut a����#��)�����-�������������������������
- G r ut a r ut a����#��)�����-�+������� ��������
r ut a1 - ot r ut a2 r ut a1����#��)���������+��9��r ut a2�
r ut a1 - nt r ut a2 r ut a1����#��)��������������9��r ut a2�
- z cadena cadena�������������������� ��+���������
- n cadena cadena�������������������� ��+�����-��9�������
cadena1 = cadena2 cadena1���������+� cadena2�
cadena1 ! = cadena2 cadena1����������#��������cadena2�
númer o1 - eq númer o2 númer o1�����<�����������+� númer o2�
númer o1 - ne númer o2 númer o1�����<������������#��������númer o2�
númer o1 - gt númer o2 númer o1�����<�����������-��9��númer o2�
númer o1 - ge númer o2 númer o1�����<�����������-����+� 9��númer o2�
númer o1 - l t númer o2 númer o1�����<���������������9��númer o2�
númer o1 - l e númer o2 númer o1�����<�����������������+� 9��númer o2�
�� ���-5���������������)��������������"�%�����t est
0������� �'��(�����
! ��+�����
- a D�= �+����
- o �1 �+����
( ) ��������������#��������������������:)-9����� �$� �����\ �������� ���� ���������+��#����
������ ��� �)� ;
�� ���-6��<�����������)��������������"�%�����t est
3.10. Comandos de escritura D�������������������� +�����������9�� �������������/��@����������6��@/���� ��� @
����
��������������� � %���������������������������
3.10.1. Comando echo
2 ������echo ������������/������6���� � ����������2 ����6���������#���������������
�������/������6������������������� ��:�����������;��/����������� ���������� ��
SI NTAXI S echo [ opci ones] mensaj e. . .
������6�#������������� /�������������#������������ �@������� /�����/������
�� ������������@-9����� /� ������������������������������@-echo �9��)���������/����
������������������������ ��������
=����A��� ����6�@echo����������������������:������$������ 4��;������������@�������
��� �$�� ��������- n�
5���� ����+��������6��� ����/�������������� < �������@� �����������������������
�����)�� ����6����9��)������� ���- n�
pol i f emo: ~$ echo Est o son 3 l et r as: a b c Est o son 3 l et r as: a b c pol i f emo: ~$ echo " Est o son 3 l et r as: a b c" Est o son 3 l et r as: a b c pol i f emo: ~$ echo - n " Est o son 3 l et r as: a b c" Est o son 3 l et r as: a b cpol i f emo: ~$
echo����� �$�������������������/ �������6��� �@������ ����������� ���/ �PATHE
pol i f emo: ~$ echo " El pat h es $PATH" El pat h es . : / usr / l ocal / bi n: / bi n: / usr / bi n: / usr / X11/ bi n: / usr / l ocal / j dk/ bi n: / usr / o penwi n/ bi n: / usr / l ocal / pascal f c/ bi n: / usr / l i b/ t eTeX/ bi n
9��(������ :��&����
- n 2���9������������������������� 4�� #�� �� ����6��
�� ���-8������'�"���������������"�%�����echo
3.10.2. Comando clear
2 ������cl ear ������� �����:/����; ��� ������������������
SI NTAXI S cl ear
��������������� � %���������������������������
3.10.3. Comando reset
2 ������ r eset ����� ��/���� ��� - �������� � ������ � �� ����� ����������1��� �<��
����� � ������ ������ �� ���#�+������ )/��� @ ��� �6��� �@ ����� /��� � # �� ���+�� 9�� )-
���#�+����� ������ ��#��������� �
SI NTAXI S r eset
3.10.4. Comando banner
2�������������������������������#��������� ������ ����
SI NTAXI S banner [ opci ones] mensaj e
�������������#���� ��?��� ��� -� ��"���� ��������- wt amaño�����6��� �E
pol i f emo: ~$ banner - w 20 hol a # # ############## # # ######## ## ####### # # # ###### # # ############## # ##### ## # # ######## #
3.11. Comandos de manejo de variables 2�������������������������������� �$������ ���6������/ ����� �)� �2� �������
F919G�+������������� ��� ��:��+����;)������������� ���6��� ����/ ���
3.11.1. Comando export
2 ������expor t �������)���9�� � � ������ ���/ ��� �)� ������������ �����+���9��
�6������ �)� �D������������������ ���6���������/ ��9��9��������"������
SI NTAXI S expor t [ var i abl e. . . ]
��������������� � % ��������������������������
�����#����@ ����/ ����#����������)� ��� �� ������)� @-������������� �����+���9��
�6�������������A �!�������������������� �)� ����������9���4��������������� �����+���
9���6��������������������������
�� �� �� ������#�� ���+<� ��������@ expor t ������ �� ������ � ���/ �� 9�� �� ����� �"�������
��� ������
3.11.2. Comando set
2 ������set ������� ��� � � �������� � ���/ ����#������D�����@������������-��������
+������������� �)� :������������ �� ��������= ��������� ������/�)�� ��+����;�
SI NTAXI S set
����6��� �E
pol i f emo: ~$ set BASH=/ bi n/ bash BASH_VERSI ON=1. 14. 7( 1) EUI D=1000 HI STFI LE=/ home/ l l or ent e/ . bash_hi st or y HI STFI LESI ZE=500 HI STSI ZE=500 HOME=/ home/ l l or ent e HOSTNAME=pol i f emo. di esi a. uhu. es HOSTTYPE=i 386 HUSHLOGI N=FALSE LOGNAME=l l or ent e LS_OPTI ONS=- - 8bi t - - col or =t t y - F - b - T 0 OSTYPE=Li nux PATH=. : / usr / l ocal / bi n: / bi n: / usr / bi n: / usr / X11/ bi n: / usr / l ocal / j dk/ bi n: / usr / openwi n/ bi n: / usr / l ocal
/ pascal f c/ bi n: / usr / l i b/ t eTeX/ b i n: / usr / l ocal / pgsql / bi n PGDATA=/ usr / l ocal / pgsql / dat a PGLI B=/ usr / l ocal / pgsql / l i b PPI D=27357 PS1=\ h: \ w\ $ SHELL=/ bi n/ bash SHLVL=1 TERM=vt 220 UI D=1000 USER=l l or ent e
3.11.3. Comando alias
2 ������al i as ������� ��� � � �� �� ��������� �� �)� @ �4��������� �- �������� �@����
)��������������� �������������������:��+����;�
SI NTAXI S al i as [ nombr e=' comando [ opci ones] ' ]
��������������� � %���������������������������
�� ���� �$� � ���6������ �� ��#������@ �����/���� � ������ �����������@- �� ��#���� �� ��@
�����/��������������� ���/���� ����+������ �4�/� �=:�����6���������������;-������������
������ �9��� ���� ��� ��� ��������� �� #��� ��������@ ��������/ ������ ����� ���� � �� �����
�������������������������6��� �Eal i as di r =' l s - al ' �
3.12. Comandos de control de tiempo ,���������9����������������������������)�������@������ ������-�6��������+���
)��������4#����
3.12.1. Comando sleep
2 ������ sl eep ����� �� )��� �� ��� :������� �6�������; ������ �� ������ :����� �����
������#��������+�����;�
SI NTAXI S sl eep t i empo[ uni dad de t i empo]
2 t i empo�����<�����������,uni dad de t i empo�� +����� ����+���������������Es:��+�����;@m
:�������;@h:)���;@d:�4�;���������� ������������������������s:��+�����;�
26��� �E)�����������*��+�����Esl eep 10�
3.12.2. Comando time
2 ������ t i me ������������� ���������6����������������������D���������������������
������� t i me �6���� ���������- �����A� ��� ������� � ������9��)������ 2��������� �� ���� ��
��������������@���������<� ��@# ������)A@����
SI NTAXI S t i me [ opci ones] comando [ ar gument os del comando]
����6��� �E
pol i f emo: ~$ t i me sl eep 2 0. 00user 0. 00syst em 0: 02. 00el apsed 0%CPU ( 0avgt ext +0avgdat a 0maxr esi dent ) k 0i nput s+0out put s ( 62maj or +8mi nor ) pagef aul t s 0swaps
3.12.3. Comando at
2�����������������6��������������)������������
SI NTAXI S at [ opci ones] comando [ ar gument os del comando]
2 ��+�������6��� ��6������� ���+��j esus1 ����� �?��� � ������/��E
��������������� � %&��������������������������
pol i f emo: ~$ at - f j esus1 11am Oct 23 Job 4 wi l l be execut ed usi ng / bi n/ sh
3.13. Comandos de ayuda 2�������� �� ���� ����� ������� ��- ���������� 9�� ������ �� �/����� ��#������� ��/�� �����
��������
3.13.1. Comando man
2 ������man :�� ���;����������� �$� ���+����� ��� ������������������� ���/��
�� ���9��9������������ ��������������������@��������� ��#������������������$9��
�������������� �������:��� I;�
SI NTAXI S man [ secci ón] t ema. . .
,���� �$������������)���������� ������ l ess@��� �9������������ �$� ��������� �
������ $�������� ��"���
2 ��� ����������#����������� ����������@������#��)����@#���������� ��+�6�!@#����������
����� ��+�6��@����B�������#��������� ���������������������������� ������������������9�A
�����������������@���������� �������������������������������������6��� �@ ��#���������
������mount ��������#���������� ��#��������� �������!mount ( ) �2�� ��������9��$�����������
������ �� 9�A ������� �� ��� �� �������� � ���9�� ��������9������� ���� ,� ��������� �� ������#���
����������<���������6��� �E
• ����� ��+���� ������mount Eman 8 mount ����� ������man mount �
• ����� ��+���� �������!mount ( ) Eman 2 mount �
=������� ��#��������� ��� @ ��������)�� ��#������������+����� ��� @ ���������
���/���� ���-���������������A������� �<������ ��������
������������#�� �������@man/����������� ����������-�������� ����� �������������9��
�������+�����������#�� +���������@man�� �/�����������������
,������������������������������������E
• �������0E��������
• ��������E ��� �������
• ������� E�������� ��+�6�!�
3.13.2. Comando whatis
2 ������what i s :("�����O;����������� �$����������������� /��� ���������� ����������
� �)� @ ��+�6�������+������@�������@����
SI NTAXI S what i s [ opci ones] t ema. . .
��������������� � %���������������������������
����6��� �E
pol i f emo: ~$ what i s l s l s, di r , vdi r ( 1) - l i st cont ent s of di r ect or i es l s- R ( 5) - dat abase f or common TeX i nput f i l es
2�� �����������@ �$9�����@�����6����������9���������������� ������� ��� :man;@���
����������� ����������������������@- �����)@��/����������������� ����D �+� 9������������
��� @ ��#���������������������what i s���������������� ������l ess�
3.13.3. Comando apropos
2 ������apr opos ������6���what i s@�����#���������#����������9���� �$��/<�9������
�"�����
SI NTAXI S what i s [ opci ones] t ema. . .
��������������� � %%��������������������������
3.14. Resumen de comandos
������� �'��(����� ����'��)�� ���&���
adduser ��������� D������������ D?�����������������
al i as ������ '��6����/ �� ���������#���� ��-������ ���"���������
apr opos �������� D-�� '�������#��������� ��������������
at ��� !����� ������ 26��������������)������������
banner �� ��� 2������� ���������������
cal ���� ���� ��#������� '�������� �������
cat �� ���� ���� �������#��)���� ���� �����������#��)����:������ ;�
cd �"� �����������'� '��6�#��)���� !�/�� ���������������#�����
chf n �"� �������� ���� D������������ !�/�� ������������ �������������
chmod �"� �������� '��6�#��)���� !�/� ��������������#��)���������������
chown �"� ����( ��� '��6�#��)���� !�/�� ����������-+��������#��)���������������
chsh �"� ����"���� D������������ !�/��� �)� 9����� �$���������
cl ear ������ 2������� >��� ��� �
cmp �������� �������#��)���� >��� ���#���������������#��)�����
comm ����� � �������#��)���� ���� � 4����������-��������������#��)�������������
cp ���'� '��6�#��)���� !����#��)�����
dat e ����� ��#������� 5��� �$���/�� #��)-)���
df ���&������ =����� ����� ������@�����-������ �/���� ���������� �������
echo ��"�� 2������� 2����/�������6��� � ����������
exi t ����� !����� ������ .�� �$� ���������� �)� �
expor t ������� '��6����/ �� ���9�������/ ���������������� �)� �����+����
expr ��������� � !� �� � 2� <���"�����������A����
f i nd �� �� �������#��)���� >������#��)����
gr ep ���� �������� ��������� �
� ����� ���������#��)���� '����� � 4�������#��)���9�������������������
hal t "���� D������������ =������� �������
head "���� �������#��)���� '����� �������� 4�������#��)����
i d ��� ��������� � ��#������� ������ �<������������#��������������:��=;-+����:F�=;�
ki l l &���� !����� �������� 2��������? ����������
l ess �����)����������������*� �������#��)���� '�������#��)��������+���@������������������������ �
l n �� &� '��6�#��)���� !���� ��������#��)�����������������
��������������� � %0��������������������������
������� �'��(����� ����'��)�� ���&���
l ogi n ���� � !����� ������ 2������ �����������������������)/��� ��������������
l ogout �������� !����� ������ .�� �$� ���������� �)� �
l pr �� ����� ���� �������#��)���� 2��4��#��)��� ���������
l s ����������������'� '��6�#��)���� ,������/������������
mai l ����� !���������� 2��4������6���������� ���������
man �� ���� D-�� 5������+���� ��� �
mcopy ��7$-�����'� =����� !���� ��#��)�����������9����'�C=���
mdi r ��7$-����������'� =����� ,���� ��#��)�����������9����'�C=���
mesg �������� !���������� D������������ ���������������6���
mkdi r ��&����������'� '��6�#��)���� !�����/������������
mkf s ��&��������'����� =����� �����������9�������#���������:,���";�
mor e ����� �������#��)���� '�������#��)���)������������������ �
mount ��� �� =����� '�������������������������
mv �� �� '��6�#��)���� !�/��� ���/��-3������#��)����:������������;�
passwd ����(���� D������������ !�/� � ��������
ps ��������������� !����� �������� ,���� ������������� ���
pwd ��� ��(��&� ����������'� '��6�#��)���� '������ ���������������#�����
r eboot ������� D������������ ������� ����������������+��-���������
r eset ������ 2������� 1������� ������ -/��� ��� �
r m ���� �� '��6�#��)���� >����#��)�����
r mdi r ���� ����������'� '��6�#��)���� >������/������������
set ���� '��6����/ �� '����� ����/ ��-���������������������� �)� �
shut down �"����( � D������������ ������� ����������������+���
sl eep ������ !����� ������ ����������
sor t ����� �������#��)���� ������ � 4�������#��)����
su ����������� !����� ������ 2������ ���������������������@����������������
t ai l ����� �������#��)���� '����� �< ���� 4�������#��)����
t est ����� !� �� � !�����/�������������
t i me ����� !����� ������ !���� ������9����������������6��������
t op ���� !����� �������� '����� ������������� ���
t t y ��'� ��#������� ������ ���/����������������� ������ ���������� �
umount � ��� �� =����� =���������������������������
��������������� � %(��������������������������
������� �'��(����� ����'��)�� ���&���
uni q � �I��� �������#��)���� '�������#��)������������� 4����+� �������+���
wc (������� �� �������#��)���� !����� �<������ 4���@� /��-������������#��)����
what i s ("�����O� D-�� '�������#��������� ��������������
who ("�� ��#������� ,��� ������������������ ��9��������
whoami ("������O� ��#������� =���� ��� ���/�����������
wr i t e (����� !���������� 2��4������6������������
�� ���/9��3���%������"�%�����=�������������'� :&�"�%��&��
��������������� � 0*��������������������������
������� �'��(����� ����'��)�� ���&���
adduser ��������� D������������ D?�����������������
chf n �"� �������� ���� D������������ !�/�� ������������ �������������
chsh �"� ����"���� D������������ !�/��� �)� 9����� �$���������
hal t "���� D������������ =������� �������
passwd ����(���� D������������ !�/� � ��������
r eboot ������� D������������ ������� ����������������+��-���������
shut down �"����( � D������������ ������� ����������������+���
apr opos �������� D-�� '�������#��������� ��������������
man �� ���� D-�� 5������+���� ��� �
what i s ("�����O� D-�� '�������#��������� ��������������
expr ��������� � !� �� � 2� <���"�����������A����
t est ����� !� �� � !�����/�������������
mai l ����� !���������� 2��4������6���������� ���������
mesg �������� !���������� D������������ ���������������6���
wr i t e (����� !���������� 2��4������6������������
ki l l &���� !����� �������� 2��������? ����������
ps ��������������� !����� �������� ,���� ������������� ���
t op ���� !����� �������� '����� ������������� ���
exi t ����� !����� ������ .�� �$� ���������� �)� �
l ogi n ���� � !����� ������ 2������ �����������������������)/��� ��������������
l ogout �������� !����� ������ .�� �$� ���������� �)� �
su ����������� !����� ������ 2������ ���������������������@����������������
at ��� !����� ������ 26��������������)������������
sl eep ������ !����� ������ ����������
t i me ����� !����� ������ !���� ������9����������������6��������
df ���&������ =����� ����� ������@�����-������ �/���� ���������� �������
mcopy ��7$-�����'� =����� !���� ��#��)�����������9����'�C=���
mdi r ��7$-����������'� =����� ,���� ��#��)�����������9����'�C=���
mkf s ��&��������'����� =����� �����������9�������#���������:,���";�
mount ��� �� =����� '�������������������������
umount � ��� �� =����� =���������������������������
banner �� ��� 2������� ���������������
��������������� � 0���������������������������
������� �'��(����� ����'��)�� ���&���
cl ear ������ 2������� >��� ��� �
echo ��"�� 2������� 2����/�������6��� � ����������
r eset ������ 2������� 1������� ������ -/��� ��� �
cal ���� ���� ��#������� '�������� �������
dat e ����� ��#������� 5��� �$���/�� #��)-)���
i d ��� ��������� � ��#������� ������ �<������������#��������������:��=;-+����:F�=;�
t t y ��'� ��#������� ������ ���/����������������� ������ ���������� �
who ("�� ��#������� ,��� ������������������ ��9��������
whoami ("������O� ��#������� =���� ��� ���/�����������
cd �"� �����������'� '��6�#��)���� !�/�� ���������������#�����
chmod �"� �������� '��6�#��)���� !�/� ��������������#��)���������������
chown �"� ����( ��� '��6�#��)���� !�/�� ����������-+��������#��)���������������
cp ���'� '��6�#��)���� !����#��)�����
l n �� &� '��6�#��)���� !���� ��������#��)�����������������
l s ����������������'� '��6�#��)���� ,������/������������
mkdi r ��&����������'� '��6�#��)���� !�����/������������
mv �� �� '��6�#��)���� !�/��� ���/��-3������#��)����:������������;�
pwd ��� ��(��&� ����������'� '��6�#��)���� '������ ���������������#�����
r m ���� �� '��6�#��)���� >����#��)�����
r mdi r ���� ����������'� '��6�#��)���� >������/������������
al i as ������ '��6����/ �� ���������#���� ��-������ ���"���������
expor t ������� '��6����/ �� ���9�������/ ���������������� �)� �����+����
set ���� '��6����/ �� '����� ����/ ��-���������������������� �)� �
cat �� ���� ���� �������#��)���� ���� �����������#��)����:������ ;�
cmp �������� �������#��)���� >��� ���#���������������#��)�����
comm ����� � �������#��)���� ���� � 4����������-��������������#��)�������������
f i nd �� �� �������#��)���� >������#��)����
gr ep ���� �������� ��������� �
� ����� ���������#��)���� '����� � 4�������#��)���9�������������������
head "���� �������#��)���� '����� �������� 4�������#��)����
l ess �����)����������������*� �������#��)���� '�������#��)��������+���@������������������������ �
l pr �� ����� ���� �������#��)���� 2��4��#��)��� ���������
mor e ����� �������#��)���� '�������#��)���)������������������ �
��������������� � 0���������������������������
������� �'��(����� ����'��)�� ���&���
sor t ����� �������#��)���� ������ � 4�������#��)����
t ai l ����� �������#��)���� '����� �< ���� 4�������#��)����
uni q � �I��� �������#��)���� '�������#��)������������� 4����+� �������+���
wc (������� �� �������#��)���� !����� �<������ 4���@� /��-������������#��)����
�� ���/���3���%������"�%�����=���������������"�&����4���
��������������� � 0 ��������������������������
4. Editores de texto 2 ,���" �� ��� �-�� �� ����� �� �������� �� ��"��� 5��� ������� /��������� �� � ��@ �� ���
������������������ �����,���"E
• C��E���������$���9����� �$ ���������/������������� �9�� ���������������7,���<��������
� ������������ ���=2��>�� ���H����H
• �����E����������-+����@���� ���-�"��������D����������#�������/6��������+��#����
• �E /����� ���� ���� �� ���6�@ ���� �� ��������� ������� � ��� 9�� �� � ������� �� ���� : �
���������������� 9������9�������;�
• (��E �� ������� �� ���+����������������� �� �� ������ ���� � �� �������� �� ���=2 ��>�� ���
H����H�����������@9������+� ������������������������� �����-�������������$�
• �(��E �������+��#��/6��CG ����7��(���
4.1. Editor joe 2 ������ C�� �� �������$ ��� 9�� ��� �$ � ����� ���/�������� �� ��� � 9�� �� �������� �����7
,���<��������� ������������ ���=2��>�� ���H����H@��� �9�������������� ����-#�� ���
D �6������ ������@������������������ ���/���� #��)���9��9�������������������������� �
������������/�����@�������������� ����-���� ��� :man j oe;�
SI NTAXI S j oe [ opci ones] [ f i cher o]
,�-��4�� ����/������������� �9����� �$C�� �����#������������� �������������������
����6��� �@���M!6:�� ���� ��� ����- ��� !@- ��+� ��� 6;C���������������� ��-��
��� ����/������������� ����������������������/����������)��������� �� ����������6��� �@
���M;:�� ���� ��� ����- ��� ;;/�������� 4���� #��)����
,B/ &��������� �������� �����/������������� �9������� �$���� ������C���
���!����� � ����'��)�� �'��(�����
^KD D��)���� F���� #��)������
^KE D��)���� !�+��#��)����������������� ��
^KB > �9��� '��� ����������/ �9���
^KC > �9��� !���� / �9������� ����������� �
^KK > �9��� '��� #�� ����/ �9���
^KM > �9��� '����� / �9������� ����������� �
^KR > �9��� ������� ���������������)����� ���������� �������
^KW > �9��� F���� / �9�����������#��)����
^KY > �9��� >����� / �9��������
^KF ><�9��� �������������#�������"�������/�������� #��)����
��������������� � 0���������������������������
���!����� � ����'��)�� �'��(�����
^L ><�9��� 1����� < ���/<�9����� �$�:/��� ��+�������������;�
^^ 2������5�� ��)��� ��< �������/������)��)��:�� ����� ��������?� @������ ��^' :������� ��� ��������#�;�2�����"������4��� ������/ ������������/��������#��������
^_ 2������=��)�� ��< �������/����2�����"������4��� ������/ ������������/��������#��������
^D 2������ >���� ������������� �����)�� �������
^O 2������ >��� � /������ �$9������� �������
^W 2������ >��� � /������ �����)�� �������
^Y 2������ >��� 4���� ���������� �������
Del 2������ >���� ������������� �$9������� �������
^A '��������� '����� ������ ����������� 4���
^E '��������� '����� ������ #�� �� 4���
^KL '��������� '����� ���������<������ 4��9������������������� ���
^KU '��������� '����� ������ ����������� #��)����
^KV '��������� '����� ������ #�� �� #��)����
^U '��������� 1������������+���
^V '��������� D��$����+���
^X '��������� '����� ��������� /� �����)�
^Z '��������� '����� ��������� /� �$9������
^C 5���� B�����-� � �"����
^KH 5���� '��������� � �������-����/��� ��� ���
^KX 5���� F���� #��)������ @������-� � �"����
^KZ 5���� � � �"������6������������:��������� ������exi t ;�
^T 5����D����� ���<�����#�+���������������������@9�����������/�����������������@����������������@�������������� /��@��?��� ��/� ������@���+����@����
�� ���/$��1�% ���"���������&�"�����������&���.��
����������� ��#��)���~/ . j oer c��� ��������������#������� ������@ ����� � �@ � �����������
�������-��- ������������� ��� ��:���/������������� �;����������� �$������������ ��)���
/ usr / l i b/ j oe/ j oer c�
4.2. Editor emacs 2 ������ ����� �� ������� C��@ ���� ���)� ��� ���� ��� - ���� �6�� 2���������� <�������� ��
#������������ ���� ������ /����� �� ��"���@ ���� �� �� ��� �� ��� ��� �� ���)� ��� �� �� , ���� ����
���� �� �������������)������� �� �����@ ��� �9�� ��� �� �"������������� ������ �� �� ���� ���� ��
,���"����� ������ ���������������������
D �6������ ������@������������������ ���/���� #��)���9��9�������������
SI NTAXI S emacs [ f i cher o]
��������������� � 0&��������������������������
D +����� ����/������������� �9����� �$����� �����#������������� �������������������
����6��� �@���M66 :�� ���� ��� ����- ��� 6@- ��+� ��� 6;����� �������������� ��
-��@�� 9���������� �����M.���������/����������)��������� �� ����������6��� �@���M
:�� ���� ��� ����- ��� ;� ���� ������������� 4���B�/�A�)-���/��������9����� �$�����
�������� ��� �����.�� �����@ +������/��������������$���� ��� ��������+��������� ������
����6��� �@�������2�:�� ���� ��� �������- ��+� ��� 2;
���!����� � ����'��)�� �'��(�����
^X̂ F D��)���� !�+��#��)��������������
^X̂ R D��)���� !�+��#��)���@� �������� ������������ �
^X̂ S D��)���� F���� #��)������ �
^X̂ W D��)���� F���� #��)������ ����������/���
^XN D��)���� F���� #��)������ ����������/���
^Espaci o > �9��� '��� �������������/ �9�����
^W > �9��� 2 ����� / �9��������
^X̂ I > �9��� ����������)����� ���������� �������
^Y > �9��� ��+� < ����/ �9��������:/�������� +<�������;������� ������� ���
Escape w > �9��� !���� / �9������� ������� ���
^R ><�9��� >���������)�������
^S ><�9��� >����������
^XR ><�9��� 1����� /<�9���)�������
^XS ><�9��� 1����� /<�9����
Escape ^R ><�9��� >���-����� $��#�������������
Escape r ><�9��� >���-����� $:������+����;�
^D 2������ >������������ �����)�
^K 2������ >���)��� #�� �� 4���
^T 2������ �������/�� ���������� ���� 9�� ���+���
^X̂ T 2������ �������/� 4����� ��� 9�� ���+���
Escape c 2������ �������-<��� � ��������������������
Escape d 2������ >������ /� �����)�
Escape l 2������ ������� /������<��� �:����� ����������;�
Escape t 2������ �������/� � /���/�� 9������� ��������� 9�� ���+���
Escape u 2������ ������� /����-<��� �:����� ����������;�
^A '��������� � � ������������� 4���
^B '��������� '����� ������ �$9�����:←;�
^E '��������� � � #�� ���� 4���
^F '��������� '����� ������ �����):→;�
^N '��������� '����� ������/6�:↓;�
^P '��������� '����� ���������/:↑;�
��B�/6����/ �9���@������� ����������� / �9�����^Espaci o@������������������� ������������� #�� @-���< ����
�#������� +�������������� / �9��@����6��� �@���^W/������� / �9���
��������������� � 0���������������������������
���!����� � ����'��)�� �'��(�����
^V '��������� D��������+���
^X] '��������� D��������+���
Escape : '��������� �������� ���������:������ 4��;�
Escape ; '��������� .���� ���������:< ��� 4��;�
Escape a '��������� � ��� 4���
Escape b '��������� '����� ��������� /� �$9������
Escape f '��������� '����� ��������� /� �����)�
Escape v '��������� 1������������+���
^X̂ C 5���� B�����������
^X̂ U 5���� =��)��� < ������/���
^XB 5���� !�/���������:������)������������;
^XX 5���� !�/� ��+��������������:������)������������;
Escape ^N 5���� !�/�� ���/������������
Escape z 5���� F�������� ��#��)����-�������
�� ���/(����"����>�"�%�������������&����%�"��
2� �����������/<�9���@������������ � � /�/����@������� �$ /<�9���:������ �
�H�I������ ����� ���;�,/<�9����������� $��������������������������������9�A)��������������
�� �����/������2�������������������������� ����������� B/ &��
0��� � -��� ��
^G !��� ��
? �/������� ��������������
. ���������-�������@���� ������� ������ ������������� �
, ���������� ������� ���������:������������������;�
y ���������-/���� ��+��������������
Espaci o ���������-/���� ��+�������������:�+� 9��y;�
n �����������-/���� ��+��������������
�� ���/-��<�"��������� +�,�����>����&�&�"�0����&���"&����
�� ����� ������� ���� ����� �� #��� �������� �� ������ �� ���� Escape - �� �<����@ -
������������6�������� �������
���������������)��� ���. emacs�������������������"�������#���� ����������� �������
����������#������������������������<����� �������������/6�/6����������+��#�������
����$��@������������ �$����#�� ������A���������"��������� ��� ���2���/��@���������� ��
�������������"����������+��#���������.������ @�� �+����� ������ 9��������������"���/����
��"���
��������������� � 0%��������������������������
4.3. Editor vi � �� � ����������� ����"��������������2�/�������#4�� �����6�@ ������������������� �
������9�� �� � 9�� ��� ������� �������� �� �� 9���� ��9��� ����� 2� �� ������� ,���"@ � ������� �
#���������������+�� @������ �)�?������������/������������� ���)��� �������������@ �����@
�����������'�C=��3G ����7���������������������� #���������������+�� �2 ������������������
������������@������ �����@� ���/���� #��)���9��9�������������
SI NTAXI S vi [ f i cher o]
�#��������� �����E�����"���@�������� ��-����� �����= �������������������������
�� 9������������� ���� ����/�������� ����� ��������� ��������,.�+�� � � ���� ��#��� ��
��������������������
�����)�
����������
�������������
exi t ^D a i A I O
: sh Escape
���� �� � �����=
?������������������'��"����%���&��������
• 2 ���� �"��� ������� �����/��- �6������������ �� �)� ��� ��$�������� �@ �������)��� ��
� ����������� �)� @�6����� +<�������@-��+����������� ����exi t �
• 2 �������� ��������������/6����� ��"��E������ ���������������@������� 4�����/ ���@
/���� 4���@ ����� 4���@ /���� � /��@ ���)���3��)���@ /���� ��"���@ +����@ � ��@ ���� ,��
���������������������� �� ������� +����� :������+������������-<��� �-���<��� �;
�/������������� /�� ������������� +<��4�/� �@����6��� �@���������:: ;�
• 2 ����� �����= �������?�����"�� ������������ ����������@�� ����� ��������������
,B/ &&�������� ��������� ���������9���������������� �$�� ������ ��
���!����� � ����'��)�� �'��(�����
: w D��)���� F���� #��)�������������
: w f i cher o D��)���� F���� #��)���������������� ���/��f i cher o�
^G D��)���� '�������#���������/��� #��)���9����������������
##Y > �9��� !��� ������� �� 4����� - �##71��+�������:����� ��� ���P�p;�
: r f i cher o > �9��� �������� ���������� ������� ����������� #��)���f i cher o�
p > �9��� ������� < ����/ �9��/�����:dd;������� ������� ��:Y;�� ��+������ 4���
P > �9��� ������� < ����/ �9��/�����:dd;������� ������� ��:Y;�� 4����� �
##G ><�9��� � � 4���<����PP@������PP�� 9�����<�����
��������������� � 00��������������������������
���!����� � ����'��)�� �'��(�����
/ pat r ón/ ><�9��� � � ���"������������� ����= �
: ## ><�9��� � � 4���<����##�
?pat r ón? ><�9��� � � ������������������ ����= �
n ><�9��� 1����� < ���/<�9����
N ><�9��� 1����� < ���/<�9���@����������������������
~ 2������ !�/�� ���������/��� ���������-<��� ����<��� �@����������
a 2������ �� ���������������@�������� ���������������� �����):���������������;�
A 2������ �� ���������������@�������� ������ #�� �� 4��:���������������;�
C 2������ 2 ����� ������� 4�� �����)-�� ���������������:���������������;�
cw 2������ 2 ����� ������� � /� �����)-�� ���������������:���������������;�
D 2������ >���)��� #�� �� 4���
dd 2������ >��� 4����� : �� ������� ��;�
dw 2������ >��� �����)�� ������)��� #�� ��� /��
i 2������ �� ���������������@��6���� �������� ����������� :���������������;�
I 2������ �� ���������������@�������� ������ ����������� 4��:���������������;�
J 2������ ��� 4����� ��� ��+�������
o 2������ �� ���������������@�������� �������� 4����+������:���������������;�
r x 2������ 1���� $� ���������/��� ���������� �������x�
x 2������ >������������ �����):� ��������/��� ������;�
X 2������ >������������ �$9�����:� ������������ ������;�
: w .��)���� F���� #��)�������������
- '��������� � � ���������������� 4����������
$ '��������� � � #�� �� 4����� �
^B '��������� 1������������+���
^D '��������� D������������+���
^E '��������� D�������� 4��:↓;
^F '��������� D��������+���
^U '��������� 1����������������+���
^Y '��������� 1������������ 4��:↑;
+ '��������� � � ���������������� 4����+�������
0 ( cer o) '��������� '����� ������)��� ����������� 4����� �
b '��������� 1��������� ������ � /���������
B '��������� 1��������� ������ � /��������@������� ����+������������������������ � /��
Del et e '��������� 1�������������������:←;
e '��������� '����� ������)��� #�� �� � /���� �
E '��������� '����� ������)��� #�� �� � /�@������� ����+������������������������ � /��
Ent er '��������� � � ���������������� 4����+�������
Espaci o '��������� D���������������:→;
H '��������� � �� �������� ����������
��������������� � 0(��������������������������
���!����� � ����'��)�� �'��(�����
L '��������� � �� #�� �� ����������
M '��������� ������ ��������� �������� ��� �
w '��������� D��$� ������ � /���+�������
W '��������� D��$� ������ � /���+������@������� ����+������������������������ � /��
z '��������� !����� ��� ������9�� ����������� �� ������9������ �������������� ��� �
z. '��������� !����� ��� �� ����������� �� �������
: ! comando �)� 26����� ������comando�� �)� �
: sh �)� �������)� ��9���������6������������:exi t ����+���� �;�
: q 5���� D/���� ��
: q! 5���� D/���� ����+���� ����/����
: set 5���� '������ ������� ���������������� ���
: set al l 5���� '������ ����������� ����������
: wq 5���� F���� #��)������������-/���� ��
: x 5���� F���� #��)������������-/���� ��
u 5���� =��)�� ��< �������/����
U 5���� 1�)�� ��< �������/������)��)���
�� ���//����"����>�"�%�������������&�����
B��� ������������� �������������������������<����@ �9��)��9�� ������������������
�<����������������6��� �@3dd/��� 4���������$@23P��+� < ������"��/������ �����@����
,�����������/<�9������ �$�� �����:. ;���������4��������������� 9��������������/����
���������/������������ �������H\ H�����6��� �@��/���� ����Het c. H��/���������/��� ��+������
������EH3et c\ . H�
������� �����������������#�+������@9�������� �������� ������� ������ : set �2���������
��/�A� ������� ���/ ���� � ��������� ��� �6��� �@ �� ����� ������ �� ���C���������� ������� �����
H: set ai H�H: set aut oi ndent H@-���������� @H: set noai H�H: set noaut oi ndent H�������������������
9����������������HnuH:�Hnumber H;@9�������� ���<������� 4�� �$9������� ��� �2�� �����
������set �����������/ �����������������
,� �������� ��/�A� ������ ���/ ������ �� �� ��)��� �� ���#�+������@ �� � ����������"��� �� ��
�������2���#��)�����/� ����H. exr cH-��/������������������������������vi �����6��� �E
. exr c set aut oi ndent aut owr i t e r epor t =2 showmat ch
4.4. Entornos wpe y xwpe (��:(� ��(���������� ��� ��� �� �;����������������+������:���� ���������;����6��� ��
�=2��>�� ��:>�� ����� @!@����;�2 ������:���.�+���;������ �-��������"�������� ������
#������������������E
• ,���&����������� �E���6���/ �9���@������� ��@����
��������������� � (*��������������������������
• �������������������������E��� �$����������������� ������������#��� ������������ �����+����
• ��7����� ���&������&���E���������������� ������� 4���������� �� ����� ���-���
����������
• /�����������'���E��� ���������)/��� ������$E�6�������������@�������������/6����:���/ ��;@��������������@����
���)���� �������������#�����������������������2�+���� ���������� �$� ��������� �9��
��C��-9���� ������������>�� ����'�C=��@������� �����<��
2"���� �� ������� �� ��������+��#���� :�CG ����7; �� �(��@ ��A���� (��@ ������� ������� ,
.�+���������� ���������(���
?������$������"&���������&����@���
�(�����������/6�/6��������+��#���@��� �9�������������� �$� ����A���������"���������
��� ��� ���������� +<� ������ ������"����������+��#�������� �.������ @ �@ ��� ��������@��/6� ��
����� ������� /6�.7(� ��(�
��������������� � (���������������������������
5. Scripts en bash ,�� �)� ������@ ����� ���������� � ������������@ ������������ ���+���#������/����
�������@ ���������)�#����E�"���7�������@�������@���� ��@������������ ��#��)����������������
����:����";��'�C=��:#��)����Q9���;@����������)�������������
D������� ���������@�� ������������������� �$����)��� ������������4������ ���+������
�������� E������������������@������������������ @����
,�� ������� �� �������� ���� ��A������ ���+��� :�������;@ - ������ ��������� �� �/�����
���� ����������� �����D +��������������������������� ����������4#����
5.1. Creación de scripts �����������@������ �����@����)�������"��9�������������� 4����������@�� 4����/ ���@�
������������,������������������$����� �������#@-����������� ������� 9������������ 4������
���������������6������������������������9�����/ �$��������������� ����������6��������� #��)���
����������������
�9+0:1-�1�2�
2 �)� ������������������#��)������������"���"������ ������ 4���� #��)���I��A����������<��������������������"��@����������9������� #��)���������"��-��������6����� �������������������/�+�@������� +<��������9������������������"��@���������6����� ����������+������� ��:/�����;�2���������������������� ������ 4�����������������/�����������������E��@������� ���������@�?��@�4�/� �������� ��@���@
2 ��+�������6��� �����������9������������ �$����������� ������� ������E��������� #��)@
��� ������-� ������������������������F��������� #��)������� ���/��ej empl o_basi coE
ej empl o_basi co dat e # MUESTRA LA FECHA cal # MUESTRA UN CALENDARI O DE ESTE MES who # MUESTRA LA LI STA DE USUARI OS CONECTADOS
2 ���� ��������6���������� ��+������E
pol i f emo: ~$ . / ej empl o_basi co Tue Oct 26 10: 05: 15 CEST 1999 Oct ober 1999 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 hans t t yr c Oct 26 09: 52 ( 192. 168. 1. 14) j avi er t t yp4 Oct 26 09: 49 ( 192. 168. 1. 29) amg t t yr 9 Oct 26 09: 51 ( 192. 168. 1. 19) j upamodo t t yr d Oct 26 10: 00 ( 192. 168. 1. 11)
�/��� ������� �������������� �$����/ ����)��� �����# �"�/ ���D������� ����� ����/ ��
9��-���������@����������������/� ����� ��� �$��������E
��������������� � (���������������������������
• ,������� � ���������/ ��������� ���
• ��� �$����������������
• 5��/ �������� ���
�� ������ �������� ����� �$���� ������r ead@��� ��+����������"��E
SI NTAXI S r ead var i abl e
var i abl e��� ���/���������/ �:���N;�����6��� �E
ej empl o_r ead echo Escr i ba al go: r ead ALGO echo Ha escr i t o l o si gui ent e: \ " $ALGO\ "
pol i f emo: ~$ . / ej empl o_r ead Escr i ba al go: En un l ugar de l a mancha. . . Ha escr i t o l o si gui ent e: " En un l ugar de l a mancha. . . "
, ��� �$���� �� ��������� ����������� �� � ����� G9F� ,��R������� :��+�� ( ;� ��� ���� ��@ �
��+����������/ ������������������������ �$����������E
• $! E��������� � ���� ��=�� < ������������6����������+����� �������6��� �E�
ej empl o_pi d sl eep 3 & # Ej ecut a al go en segundo pl ano echo El pr oceso ant er i or t i ene PI D $! ps # Muest r a l os PI D de t odos l os pr ocesos, par a poder compar ar
pol i f emo: ~$ . / ej empl o_pi d El pr oceso ant er i or t i ene PI D 7515 PI D TTY STAT TI ME COMMAND 6650 r 8 S 0: 00 - bash 7514 r 8 S 0: 00 - bash 7515 r 8 S 0: 00 sl eep 3 7516 r 8 R 0: 00 ps
• $?E��������� � ����� ���� < �����������6�������!���������+��������@�����������
�����@9�������<�������� ���+����������#������� @����� �����������O�����������
+<������������@� � ������� ���������������������'��)������������ �$��������������,
<���#������������� � ������������������������������� �����������/ ��26��� �E
ej empl o_t est t est 0 - eq 1 # Debe t er mi nar con er r or echo $?
��������������� � ( ��������������������������
t est 0 - eq 0 # Debe t er mi nar cor r ect ament e echo $?
pol i f emo: ~$ . / ej empl o_t est 1 0
2� �� ��� ���� ���/ �� ��/�A� �� ������ ��� �$� ����� 4�� �� ������� :��� ������;@ �����
�����/������������������ ����������
�������)���9����������������������������������������� ������������2 ������exi t :9��
)�� )�� ��� ) ������� �� � �� �� ������; ������� ������� ������������ �� ������@ ��� �� �����
�����������,����"����E
SI NTAXI S exi t [ est ado]
est ado�����<����9�������� �������#�� �$����@9����/����*���������������������������-
��� ��������������������������������:���� ���������������� �$� �<��������������������
���������������������������;������������est ado@�����������*�2 ��+�������6��� �����������������
�����%E
ej empl o_exi t echo Hol a exi t 17 echo Est o nunca se escr i be! ! !
�� ��6�������-������������ �$���� ����+��������@�/�������9�� ����#�� �� ���+����
���6����@-9������������������%E
pol i f emo: ~$ . / ej empl o_exi t ; echo $? Hol a 17
5.2. Parámetros ,���������������������+����������������������������� ����������#�������/ ����� ��
���/����� B/ &��
��������������� � (���������������������������
<����!&�� �'��(�����
$1 �������������������
$2 ��+�����������������
$3 B������������������
. . .
${ 10} =A�����������������
${ 11} ���A�����������������
. . .
$* B���� ����������������:����������� ��������������� ���/ �I FS;�
$0 ���/���� ��)����6������:������� ��;�
$# �<���������������������
�� ���/2��7���� ��������""�������������)%�&���
������� ����� � ��������������������:����6��� �@$4������� �)-����������;@� � ��
����� ��������������4�
����� �$� �����������������������#�����A����:�������@$10@$11@$12@����;�������9���������
����� ���� �<����:�������@${ 10} @${ 11} @${ 12} @����;@-9���� ��������������#���������� +����� ��
�*�������������������+������� +<��<����:�������@ ��9��� ����${ 1} 0@${ 1} 1@${ 1} 2@����;
2 ������ shi f t ��� ������� �����)� � �������� ������� :N�; - ���� $� �� �������� � ����� ��
���������@������9��N�������� ����������N�@N ��N�@-�4�������������2�������������
��� �$� �������������� ������������������� ���������
5���� �� �6��� �������� �����������-� ������shi f t � �� � ��+������ ������@9�� ������
ej empl o_par E
ej empl o_par echo Hay $# ar gument os, que son: $* echo Ar gument os 1, 2 y 3: echo $1 $2 $3 shi f t echo Ar gument os 2, 3 y 4: echo $1 $2 $3
,��+������� �����������6��� ������6�������E
pol i f emo: ~$ . / ej empl o_par A B C D E Hay 5 ar gument os, que son: A B C D E Ar gument os 1, 2 y 3: A B C Ar gument os 2, 3 y 4: B C D
��������������� � (&��������������������������
5.3. Sentencias de control =��������� ���������������� �$� +����� �����������)/��� ���� �� ��+�6�������+������
����������E���������� ��������:/�� �����@("���@����;-������������ ������ : �������@ ��������< ��� �@
����;�
5.3.1. Estructura iterativa for
������� �6����� �� �������� �� ������� ���� �����@ - �� �� �� �� � � ��+� �� � �� ��
���/ �@������������6����������/ ��� �����
SI NTAXI S f or var i abl e i n conj unt o do comandos done
var i abl e��� ���/���������/ �:���N;�conj unt o�������6������� ����9����������+����
���/ ������������������������ �$�����#�����������6���������������/�����#��)����:����* . t xt ;@
���6����� �� � ���� :���� $* ;@ � �� ��$� �� �/� ���� :���� * . t xt $1 f i cher o1 pal abr a1 / t mp/ * . c;�
.�� ����� comandos �� �������� �� 4��� ��� ������� 9�� �� �6������� �� �� ��������� �� �6��� �E
������������������� ��������� ����)���������������������@)����������������#��)���-#��)���E
ej empl o_f or f or I i n $* do cl ear echo Cont eni do del f i cher o $I echo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cat $I sl eep 1 done
2���� �� ������� ��������� ��� � /�� � :����� do - done; �� ����� ��� ��� +�� �� � ��+�������
���������E
• br eakE ������� ������ � /�� �@ ������9�� �6�������������< ��� ����������� ������������
��������� done����������:�+� 9��� ����&��!;�
• cont i nueE ������� ������ ��+������ �������� ��#��� ������� :��� �������� �� �+� done;@ ��
#���9��� ���"���������9�����6������ ��+��������������� �� ���/ ���������
:�+� 9��� �� �� ����!;�
5.3.2. Estructura iterativa while
�������������� �6��������������������������������������A������������
SI NTAXI S whi l e condi ci ón do comandos done
��������������� � (���������������������������
condi ci ón����������9���������� ��������< ����������� ���������������A"���@��������<
�������I���� ��������@����������������@������� /�� ��comandos�� ���������� 4�������������9��
���6��������������������
5�������6��� �E�����/�� ���<������� � *E
ej empl o_whi l e NUM=1 whi l e [ $NUM - l e 30 ] do echo $NUM NUM=` expr $NUM + 1` done
2"�����������������-<�� ���������� �$���������������/�� ���������� ��������� t r ue-
f al seE
• t r ue����������9����)����@����9��������������������A"���:*;�
• f al se������)����@���������������������������:����������*;�
��� �����@���������� �$������������������"�������9������������� <��������:t r ue;�
# ��:f al se;�2����������@������������)�����/� �����@����/�� ����#�������
2� wi hl e�����������/�A����������� �$� ����������br eak-cont i nueE
• br eakE ������� ������ � /�� �@ ������9�� �6�������������< ��� ����������� ������������
��������� done����������:�+� 9��� ����&��!;�
• cont i nueE ������� ������ ��+������ �������� ��#��� ������� :��� �������� �� �+� done;@ ��
#���9��� ���"���������9�����6������ �� ������� ����������������������:�+� 9���
�� �� ����!;�
5.3.3. Estructura iterativa until
�������������� �6����������������������������)��9�����A������������
SI NTAXI S unt i l condi ci ón do comandos done
2 #�������������� ��A����� �� ���������("���@ �"��������9�� ����������� � ���� /�� � ��
������� ��A�������������� ���� �6��� ��������i f :�����������;�
5.3.4. Estructura alternativa simple (if)
�������/�#���� �6��������������� ��������@��+<�� � ����������������
SI NTAXI S i f condi ci ón t hen comandos [ el se
��������������� � (%��������������������������
comandos_al t er nat i vos] f i
condi ci ón����������9��������9�A�����6����@ �"� @� �������� ���������������A"���@
���6����� ����������� ���"� I���� ��������@����������������@���6����� ����������� ��
�����
comandos�� ���������� 4�������������9�����6��������� ���"� � comandos_al t er nat i vos
�� ���������� �������,���������������� �
5�������6��� �E� 6��+���������� �<������� /������#��)������������������E
ej empl o_i f TAMANO=` wc - w <$1` # Numer o de pal abr as NUMERO=- 1 # I ni ci amos de maner a que ent r e en el bucl e unt i l [ $TAMANO - eq $NUMERO ] do echo Adi vi na el numer o de pal abr as del f i cher o $1 r ead NUMERO i f [ $NUMERO - gt $TAMANO ] t hen echo El f i cher o $1 t i ene menos pal abr as. el se i f [ $NUMERO - l t $TAMANO ] t hen echo El f i cher o $1 t i ene mas pal abr as. f i f i done echo HAS ACERTADO! ! ! !
5.3.5. Estructura alternativa múltiple (case)
�������/�#���� �6������������������� ��������@��+<�� � �������"��������
SI NTAXI S case expr esi on i n val or 1) comandos1 comandos1; ; [ val or 2) comandos2 comandos2; ; ] . . . [ * ) ot r os_comandos ot r os_comandos; ; ] esac
expr esi ón����������9��������9�A�����6�����2�����������/������/����� � ���������
�� � ��9�� ���������������� ��� �� ���������val or 1@val or 2@ ����2� � �����9������������
+�����������������@�6������ ���������������� �����)��H) H-�� � 4�����������)����������
H; ; H�������������������+����� ��� ��������������@-�"������������* ) @���������6���� ���������
����������)�������
!� � �� ��������� ����� ��� �� <���� � ��� �����6���� �� � ����@ ������� ��� HZH@- �������� ��
�������� ����������� �"������������������� 9������ ��� �����
��������������� � (0��������������������������
2 ��+�������6��� ������������<���������������6���#��)���������������������������
��������#�������@�����������@/���� �@����
ej empl o_case whi l e t r ue do echo OPCI ONES echo - - - - - - - - echo L - l i st ar i nf or maci ón del f i cher o $1 echo V - vi sual i zar cont eni do del f i cher o $1 echo E - edi t ar f i cher o $1 echo R - bor r ar f i cher o $1 echo A - Abor t ar echo echo - n " Sel ecci ona una opci ón: " r ead OPCI ON cl ear case $OPCI ON i n L) l s - l $1; ; E) vi $1; ; V) mor e $1; ; R) r m - f $1 br eak; ; A) br eak; ; l | e| r | a| v) echo Debes escr i bi r l a opci ón en mayúscul as. ; ; * ) echo Esa opci ón no exi st e; ; esac done
5.4. Depuración de scripts !�����������6���������������@������������ �����������������9�����6����@�����9��
�������� ������W��� /�)@��� �$������ �� ������set :������������ �� ��������= ��������� ���
���/�)�� ��+����;�2��������������� ����-<�� ���/��9�A�� �9���� ����������������������
�������
5��������6��� � �6��������� ��+��������������� �$��� ������–vE
scr i pt cuent a I =$1 whi l e [ $I - gt 0 ] do echo $I I =` expr $I - 1` done
pol i f emo: ~$ set - v pol i f emo: ~$ cuent a 5 cuent a 5 I =$1 whi l e [ $I - gt 0 ] do echo $I I =` expr $I - 1` done 5
��������������� � ((��������������������������
expr $I - 1 4 expr $I - 1 3 expr $I - 1 2 expr $I - 1 1 expr $I – 1
2� �+���W�@���������� �$�W"@9����������� �9���� ��������6�������������������E
pol i f emo: ~$ set +v set +v pol i f emo: ~$ set - x pol i f emo: ~$ cuent a 5 + cuent a 5 ++ I =5 ++ [ 5 - gt 0 ] ++ echo 5 5 +++ expr 5 - 1 ++ I =4 ++ [ 4 - gt 0 ] ++ echo 4 4 +++ expr 4 - 1 ++ I =3 ++ [ 3 - gt 0 ] ++ echo 3 3 +++ expr 3 - 1 ++ I =2 ++ [ 2 - gt 0 ] ++ echo 2 2 +++ expr 2 - 1 ++ I =1 ++ [ 1 - gt 0 ] ++ echo 1 1 +++ expr 1 - 1 ++ I =0 ++ [ 0 - gt 0 ]
5.5. Scripts de iniciación 2"����� +�����������9�����6�������#���������������$9������������ ������������ ��
��� �$� �� ��#���� +��� ���/ �� ���������� :���� � ���";- �6������������ �� ���������� ,B/ &%
����+� +������� ���,��9���������������� �������������"����� ������������������ �$/ �������
������I�����/�+�@ �9�����������/�� ������������������������ ����������
��������������� � �**��������������������������
,��"���� ���&���
~/ . bash_pr of i l e ���6��������$9��������� ������@��������bash�����)� �����#������
~/ . bash_l ogi n ���6��������$9��������� ������@��������bash�����)� �����#�����@�������-�������
�"���~/ . bash_pr of i l e�
~/ . pr of i l e ���6��������$9��������� ������@����� 9�����)� �����#�����:��� �)� ��bash@�� ����6����. pr of i l e�����"�����~/ . bash_pr of i l e��~/ . bash_l ogi n;�
/ et c/ pr of i l e ���6��������$9��������� ������@��������bash�����)� �����#������
~/ . bashr c ���6��������$9�����6����bash������������:������������;��������������������
���������su�
�� ���/5���"���&��������"��"�0�
��������������� � �*���������������������������
6. Bibliografía complementaria
6.1. Libros de Sistemas Operativos y UNIX
R=��( S =���� @��'�@U���&�%��������&������$A����"�0��V@D������CG �� �-@�(( �
R'� 00S '� ��8����@'�@U���&�%���<����&������1��"��&���>�����B�V@'�F�7C�� @�(00�
R'� 00S '� ��8����@'�@U���&�%��������&����V@'�F�7�� @�(00�
R'��0(S '��+�@1�@'�F� ���@��@U�&����""�0�����������&�%��7V@'�F�7C�� @�(0(�
R�� (�S �� /����)�$@ D�@ ��������@ b�@ F ���@ ��@ U���&�%��������&������1��"��&���'����%��&������ (A����"�0�V@
D������CG �� �-@�((��
R��(%S �� ��+�@G �@U���&�%��������&������$A����"�0�V@��������� @�((%�
RB�(0S B���/��@D���@U���&�%���<����&����������B����%���%��&�"�0�V@���������C� @�((0�
6.2. Libros de Linux en la Biblioteca
R>��(%S >��8@'�@U������C�������&������V@D������CG �� �-@�((%:�0�� �*��,���";�
R> (�S > ���@5�b�@U�����D���&���"�0�=���%����&��"�0��>������������&�%�V@1DC'D@�((�:�0�� �*��,���";�
R!�(%S !��@1�=���@2�@'�� @.�@U �����%�"�0��������$�9D�� �������&�%��>�?��"����%���&������+"���V@
F�������***@�((%:�0�� �*��,���";�
R'�(0S '��4��A��$@!�@�A��$!�����@��@U�����V@D�-'� ������@�((0:�0�� �*��,���";�
R���(0S ��������@1�@U�����D�&*��1�%���&��3�'����"�V@��/����@�((0:�0�� �*��,���";�
RB�(�S B�8���@b�@F�����@=�@U�&���;����������V@��������� @�((�:�0�� �*��,���";�
RB�(0S B�8���@b�@F�����@=�@U�����D����"�0������"���V@��������� @�((0:�0�� �*��,���";�
RG � (�S G � �)@'�@`�#�@,�@U3������������V@�c1�� -@�((�:�0�� �*��,���";�
6.3. Libros de UNIX en la Biblioteca
RD��(�S D��)��@,�b�@>����@B�@U����*���� �����%%���V@b�)�G � �-d����@�((�:�0�� �*������;
R!)�(*S !)������@ �̀@U��""�����������1�>���V@D�-'� ������@�((*:�0�� �*��!@�0�� �*������;
R!)�(�S !)������@ �̀@U��V@�����#�@�((�:�0�� �*������;
R!�#(*S !�##��@��@U��D�����������3�'����"��D���"��>�����&�%��7������0��(V@��/����3'�F�7C�� @ �((*
:�0�� �*������;
��������������� � �*���������������������������
R��(�S ��� ��@ �̀� �@>�@U��&%��>�&�%� �����%%���V@D������CG �� �-@�((�:�0�� �*������;
R̀ ��(�S `����+)�@>�G �@��8�@1�@U�����&�������� �����%�"�0����V@��������C� ������������@�((�
:�0�� �*������;
R,�>(*S ,�> ���@F�B�@> ���@��1�@'����@G �@U����������>�&�%�7D���������(V@��/����3'�F�7C�� @�((*
:�0�� �*������;
R���(&S �����)@2�@U����>�&�%���%����&��&�������� ��EV@��������� @�((&:�0�� �*������;
R���(%S ����@D�@U�����&�������V@D/���@�((%:�0�� �*������;
R��0(S ���@ ��@'����@=�@U������&�%��7D�����������3�'����"������&���������1�%������>��&��������V@
D�-'� ������@�(0(:�0�� �*������;
R1��(%S 1����@ �̀��@U��D����&�%��7=������0��-V@��/����3'�F�7C�� @�((%:�0�� �*������;
R���(�S ����)�$@��@U��D���4�������������V@1DC'D@�((�:�0�� �*������;
RB)�0&S B)���@ 1�@ O���@ b�@ U���&�%�� <����&���� ��D� ��4�� ���� �������V@ '�F�7C�� @ �(0& :�0�� �*��
����;
RG �0�S G ���@'�@'����@=�@����@��@U�&����""�0�����������&�%��7V@D�-'� ������@�(0�:�0�� �*��
����;
Recommended